af_iucv: accelerate close for HS transport
authorUrsula Braun <ursula.braun@de.ibm.com>
Mon, 19 Dec 2011 22:56:28 +0000 (22:56 +0000)
committerDavid S. Miller <davem@davemloft.net>
Tue, 20 Dec 2011 19:05:03 +0000 (14:05 -0500)
Closing an af_iucv socket may wait for confirmation of outstanding
send requests. This patch adds confirmation code for the new
HiperSockets transport.

Signed-off-by: Ursula Braun <ursula.braun@de.ibm.com>
Signed-off-by: Frank Blaschka <frank.blaschka@de.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/iucv/af_iucv.c

index f4ad720..32a5010 100644 (file)
@@ -2293,6 +2293,13 @@ static void afiucv_hs_callback_txnotify(struct sk_buff *skb,
        }
        spin_unlock_irqrestore(&list->lock, flags);
 
+       if (sk->sk_state == IUCV_CLOSING) {
+               if (skb_queue_empty(&iucv_sk(sk)->send_skb_q)) {
+                       sk->sk_state = IUCV_CLOSED;
+                       sk->sk_state_change(sk);
+               }
+       }
+
 out_unlock:
        bh_unlock_sock(sk);
 }