diff options
author | David S. Miller <davem@davemloft.net> | 2010-05-03 06:43:40 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-05-03 07:02:06 +0200 |
commit | 7ef527377b88ff05fb122a47619ea506c631c914 (patch) | |
tree | 2c2e774527d5f591b975834f43e8c6fd12fb38f2 /net/sctp/socket.c | |
parent | net: Inline skb_pull() in eth_type_trans(). (diff) | |
parent | net: fix compile error due to double return type in SOCK_DEBUG (diff) | |
download | linux-7ef527377b88ff05fb122a47619ea506c631c914.tar.xz linux-7ef527377b88ff05fb122a47619ea506c631c914.zip |
Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6
Diffstat (limited to 'net/sctp/socket.c')
-rw-r--r-- | net/sctp/socket.c | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/net/sctp/socket.c b/net/sctp/socket.c index d54700af927a..bae764005d2d 100644 --- a/net/sctp/socket.c +++ b/net/sctp/socket.c @@ -3719,9 +3719,9 @@ SCTP_STATIC int sctp_init_sock(struct sock *sk) sp->hmac = NULL; SCTP_DBG_OBJCNT_INC(sock); - percpu_counter_inc(&sctp_sockets_allocated); local_bh_disable(); + percpu_counter_inc(&sctp_sockets_allocated); sock_prot_inuse_add(sock_net(sk), sk->sk_prot, 1); local_bh_enable(); @@ -3738,8 +3738,8 @@ SCTP_STATIC void sctp_destroy_sock(struct sock *sk) /* Release our hold on the endpoint. */ ep = sctp_sk(sk)->ep; sctp_endpoint_free(ep); - percpu_counter_dec(&sctp_sockets_allocated); local_bh_disable(); + percpu_counter_dec(&sctp_sockets_allocated); sock_prot_inuse_add(sock_net(sk), sk->sk_prot, -1); local_bh_enable(); } @@ -6185,6 +6185,19 @@ do_nonblock: goto out; } +void sctp_data_ready(struct sock *sk, int len) +{ + struct socket_wq *wq; + + rcu_read_lock(); + wq = rcu_dereference(sk->sk_wq); + if (wq_has_sleeper(wq)) + wake_up_interruptible_sync_poll(&wq->wait, POLLIN | + POLLRDNORM | POLLRDBAND); + sk_wake_async(sk, SOCK_WAKE_WAITD, POLL_IN); + rcu_read_unlock(); +} + /* If socket sndbuf has changed, wake up all per association waiters. */ void sctp_write_space(struct sock *sk) { |