patch-2.4.21 linux-2.4.21/net/netlink/af_netlink.c
Next file: linux-2.4.21/net/netrom/nr_dev.c
Previous file: linux-2.4.21/net/irda/parameters.c
Back to the patch index
Back to the overall index
- Lines: 44
- Date:
2003-06-13 07:51:39.000000000 -0700
- Orig file:
linux-2.4.20/net/netlink/af_netlink.c
- Orig date:
2002-11-28 15:53:16.000000000 -0800
diff -urN linux-2.4.20/net/netlink/af_netlink.c linux-2.4.21/net/netlink/af_netlink.c
@@ -562,6 +562,14 @@
read_unlock(&nl_table_lock);
}
+static inline void netlink_rcv_wake(struct sock *sk)
+{
+ if (skb_queue_len(&sk->receive_queue) == 0)
+ clear_bit(0, &sk->protinfo.af_netlink->state);
+ if (!test_bit(0, &sk->protinfo.af_netlink->state))
+ wake_up_interruptible(&sk->protinfo.af_netlink->wait);
+}
+
static int netlink_sendmsg(struct socket *sock, struct msghdr *msg, int len,
struct scm_cookie *scm)
{
@@ -675,12 +683,7 @@
netlink_dump(sk);
out:
- if (skb_queue_len(&sk->receive_queue) <= sk->rcvbuf/2) {
- if (skb_queue_len(&sk->receive_queue) == 0)
- clear_bit(0, &sk->protinfo.af_netlink->state);
- if (!test_bit(0, &sk->protinfo.af_netlink->state))
- wake_up_interruptible(&sk->protinfo.af_netlink->wait);
- }
+ netlink_rcv_wake(sk);
return err ? : copied;
}
@@ -688,13 +691,7 @@
{
if (sk->protinfo.af_netlink->data_ready)
sk->protinfo.af_netlink->data_ready(sk, len);
-
- if (skb_queue_len(&sk->receive_queue) <= sk->rcvbuf/2) {
- if (skb_queue_len(&sk->receive_queue) == 0)
- clear_bit(0, &sk->protinfo.af_netlink->state);
- if (!test_bit(0, &sk->protinfo.af_netlink->state))
- wake_up_interruptible(&sk->protinfo.af_netlink->wait);
- }
+ netlink_rcv_wake(sk);
}
/*
FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)