aboutsummaryrefslogtreecommitdiffstats
path: root/net/sctp/socket.c
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2010-05-03 00:43:40 -0400
committerDavid S. Miller <davem@davemloft.net>2010-05-03 01:02:06 -0400
commit7ef527377b88ff05fb122a47619ea506c631c914 (patch)
tree2c2e774527d5f591b975834f43e8c6fd12fb38f2 /net/sctp/socket.c
parent47d29646a2c1c147d8a7598aeac2c87dd71ed638 (diff)
parent1183f3838c588545592c042c0ce15015661ce7f2 (diff)
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.c17
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)
3719 sp->hmac = NULL; 3719 sp->hmac = NULL;
3720 3720
3721 SCTP_DBG_OBJCNT_INC(sock); 3721 SCTP_DBG_OBJCNT_INC(sock);
3722 percpu_counter_inc(&sctp_sockets_allocated);
3723 3722
3724 local_bh_disable(); 3723 local_bh_disable();
3724 percpu_counter_inc(&sctp_sockets_allocated);
3725 sock_prot_inuse_add(sock_net(sk), sk->sk_prot, 1); 3725 sock_prot_inuse_add(sock_net(sk), sk->sk_prot, 1);
3726 local_bh_enable(); 3726 local_bh_enable();
3727 3727
@@ -3738,8 +3738,8 @@ SCTP_STATIC void sctp_destroy_sock(struct sock *sk)
3738 /* Release our hold on the endpoint. */ 3738 /* Release our hold on the endpoint. */
3739 ep = sctp_sk(sk)->ep; 3739 ep = sctp_sk(sk)->ep;
3740 sctp_endpoint_free(ep); 3740 sctp_endpoint_free(ep);
3741 percpu_counter_dec(&sctp_sockets_allocated);
3742 local_bh_disable(); 3741 local_bh_disable();
3742 percpu_counter_dec(&sctp_sockets_allocated);
3743 sock_prot_inuse_add(sock_net(sk), sk->sk_prot, -1); 3743 sock_prot_inuse_add(sock_net(sk), sk->sk_prot, -1);
3744 local_bh_enable(); 3744 local_bh_enable();
3745} 3745}
@@ -6185,6 +6185,19 @@ do_nonblock:
6185 goto out; 6185 goto out;
6186} 6186}
6187 6187
6188void sctp_data_ready(struct sock *sk, int len)
6189{
6190 struct socket_wq *wq;
6191
6192 rcu_read_lock();
6193 wq = rcu_dereference(sk->sk_wq);
6194 if (wq_has_sleeper(wq))
6195 wake_up_interruptible_sync_poll(&wq->wait, POLLIN |
6196 POLLRDNORM | POLLRDBAND);
6197 sk_wake_async(sk, SOCK_WAKE_WAITD, POLL_IN);
6198 rcu_read_unlock();
6199}
6200
6188/* If socket sndbuf has changed, wake up all per association waiters. */ 6201/* If socket sndbuf has changed, wake up all per association waiters. */
6189void sctp_write_space(struct sock *sk) 6202void sctp_write_space(struct sock *sk)
6190{ 6203{