aboutsummaryrefslogtreecommitdiffstats
path: root/net/sctp/socket.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/sctp/socket.c')
-rw-r--r--net/sctp/socket.c37
1 files changed, 18 insertions, 19 deletions
diff --git a/net/sctp/socket.c b/net/sctp/socket.c
index 44a1ab03a3f0..bae764005d2d 100644
--- a/net/sctp/socket.c
+++ b/net/sctp/socket.c
@@ -3720,9 +3720,6 @@ SCTP_STATIC int sctp_init_sock(struct sock *sk)
3720 3720
3721 SCTP_DBG_OBJCNT_INC(sock); 3721 SCTP_DBG_OBJCNT_INC(sock);
3722 3722
3723 /* Set socket backlog limit. */
3724 sk->sk_backlog.limit = sysctl_sctp_rmem[1];
3725
3726 local_bh_disable(); 3723 local_bh_disable();
3727 percpu_counter_inc(&sctp_sockets_allocated); 3724 percpu_counter_inc(&sctp_sockets_allocated);
3728 sock_prot_inuse_add(sock_net(sk), sk->sk_prot, 1); 3725 sock_prot_inuse_add(sock_net(sk), sk->sk_prot, 1);
@@ -5482,7 +5479,6 @@ pp_found:
5482 */ 5479 */
5483 int reuse = sk->sk_reuse; 5480 int reuse = sk->sk_reuse;
5484 struct sock *sk2; 5481 struct sock *sk2;
5485 struct hlist_node *node;
5486 5482
5487 SCTP_DEBUG_PRINTK("sctp_get_port() found a possible match\n"); 5483 SCTP_DEBUG_PRINTK("sctp_get_port() found a possible match\n");
5488 if (pp->fastreuse && sk->sk_reuse && 5484 if (pp->fastreuse && sk->sk_reuse &&
@@ -5703,7 +5699,7 @@ unsigned int sctp_poll(struct file *file, struct socket *sock, poll_table *wait)
5703 struct sctp_sock *sp = sctp_sk(sk); 5699 struct sctp_sock *sp = sctp_sk(sk);
5704 unsigned int mask; 5700 unsigned int mask;
5705 5701
5706 poll_wait(file, sk->sk_sleep, wait); 5702 poll_wait(file, sk_sleep(sk), wait);
5707 5703
5708 /* A TCP-style listening socket becomes readable when the accept queue 5704 /* A TCP-style listening socket becomes readable when the accept queue
5709 * is not empty. 5705 * is not empty.
@@ -5944,7 +5940,7 @@ static int sctp_wait_for_packet(struct sock * sk, int *err, long *timeo_p)
5944 int error; 5940 int error;
5945 DEFINE_WAIT(wait); 5941 DEFINE_WAIT(wait);
5946 5942
5947 prepare_to_wait_exclusive(sk->sk_sleep, &wait, TASK_INTERRUPTIBLE); 5943 prepare_to_wait_exclusive(sk_sleep(sk), &wait, TASK_INTERRUPTIBLE);
5948 5944
5949 /* Socket errors? */ 5945 /* Socket errors? */
5950 error = sock_error(sk); 5946 error = sock_error(sk);
@@ -5981,14 +5977,14 @@ static int sctp_wait_for_packet(struct sock * sk, int *err, long *timeo_p)
5981 sctp_lock_sock(sk); 5977 sctp_lock_sock(sk);
5982 5978
5983ready: 5979ready:
5984 finish_wait(sk->sk_sleep, &wait); 5980 finish_wait(sk_sleep(sk), &wait);
5985 return 0; 5981 return 0;
5986 5982
5987interrupted: 5983interrupted:
5988 error = sock_intr_errno(*timeo_p); 5984 error = sock_intr_errno(*timeo_p);
5989 5985
5990out: 5986out:
5991 finish_wait(sk->sk_sleep, &wait); 5987 finish_wait(sk_sleep(sk), &wait);
5992 *err = error; 5988 *err = error;
5993 return error; 5989 return error;
5994} 5990}
@@ -6062,14 +6058,14 @@ static void __sctp_write_space(struct sctp_association *asoc)
6062 wake_up_interruptible(&asoc->wait); 6058 wake_up_interruptible(&asoc->wait);
6063 6059
6064 if (sctp_writeable(sk)) { 6060 if (sctp_writeable(sk)) {
6065 if (sk->sk_sleep && waitqueue_active(sk->sk_sleep)) 6061 if (sk_sleep(sk) && waitqueue_active(sk_sleep(sk)))
6066 wake_up_interruptible(sk->sk_sleep); 6062 wake_up_interruptible(sk_sleep(sk));
6067 6063
6068 /* Note that we try to include the Async I/O support 6064 /* Note that we try to include the Async I/O support
6069 * here by modeling from the current TCP/UDP code. 6065 * here by modeling from the current TCP/UDP code.
6070 * We have not tested with it yet. 6066 * We have not tested with it yet.
6071 */ 6067 */
6072 if (sock->fasync_list && 6068 if (sock->wq->fasync_list &&
6073 !(sk->sk_shutdown & SEND_SHUTDOWN)) 6069 !(sk->sk_shutdown & SEND_SHUTDOWN))
6074 sock_wake_async(sock, 6070 sock_wake_async(sock,
6075 SOCK_WAKE_SPACE, POLL_OUT); 6071 SOCK_WAKE_SPACE, POLL_OUT);
@@ -6191,12 +6187,15 @@ do_nonblock:
6191 6187
6192void sctp_data_ready(struct sock *sk, int len) 6188void sctp_data_ready(struct sock *sk, int len)
6193{ 6189{
6194 read_lock_bh(&sk->sk_callback_lock); 6190 struct socket_wq *wq;
6195 if (sk_has_sleeper(sk)) 6191
6196 wake_up_interruptible_sync_poll(sk->sk_sleep, POLLIN | 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 |
6197 POLLRDNORM | POLLRDBAND); 6196 POLLRDNORM | POLLRDBAND);
6198 sk_wake_async(sk, SOCK_WAKE_WAITD, POLL_IN); 6197 sk_wake_async(sk, SOCK_WAKE_WAITD, POLL_IN);
6199 read_unlock_bh(&sk->sk_callback_lock); 6198 rcu_read_unlock();
6200} 6199}
6201 6200
6202/* If socket sndbuf has changed, wake up all per association waiters. */ 6201/* If socket sndbuf has changed, wake up all per association waiters. */
@@ -6307,7 +6306,7 @@ static int sctp_wait_for_accept(struct sock *sk, long timeo)
6307 6306
6308 6307
6309 for (;;) { 6308 for (;;) {
6310 prepare_to_wait_exclusive(sk->sk_sleep, &wait, 6309 prepare_to_wait_exclusive(sk_sleep(sk), &wait,
6311 TASK_INTERRUPTIBLE); 6310 TASK_INTERRUPTIBLE);
6312 6311
6313 if (list_empty(&ep->asocs)) { 6312 if (list_empty(&ep->asocs)) {
@@ -6333,7 +6332,7 @@ static int sctp_wait_for_accept(struct sock *sk, long timeo)
6333 break; 6332 break;
6334 } 6333 }
6335 6334
6336 finish_wait(sk->sk_sleep, &wait); 6335 finish_wait(sk_sleep(sk), &wait);
6337 6336
6338 return err; 6337 return err;
6339} 6338}
@@ -6343,7 +6342,7 @@ static void sctp_wait_for_close(struct sock *sk, long timeout)
6343 DEFINE_WAIT(wait); 6342 DEFINE_WAIT(wait);
6344 6343
6345 do { 6344 do {
6346 prepare_to_wait(sk->sk_sleep, &wait, TASK_INTERRUPTIBLE); 6345 prepare_to_wait(sk_sleep(sk), &wait, TASK_INTERRUPTIBLE);
6347 if (list_empty(&sctp_sk(sk)->ep->asocs)) 6346 if (list_empty(&sctp_sk(sk)->ep->asocs))
6348 break; 6347 break;
6349 sctp_release_sock(sk); 6348 sctp_release_sock(sk);
@@ -6351,7 +6350,7 @@ static void sctp_wait_for_close(struct sock *sk, long timeout)
6351 sctp_lock_sock(sk); 6350 sctp_lock_sock(sk);
6352 } while (!signal_pending(current) && timeout); 6351 } while (!signal_pending(current) && timeout);
6353 6352
6354 finish_wait(sk->sk_sleep, &wait); 6353 finish_wait(sk_sleep(sk), &wait);
6355} 6354}
6356 6355
6357static void sctp_skb_set_owner_r_frag(struct sk_buff *skb, struct sock *sk) 6356static void sctp_skb_set_owner_r_frag(struct sk_buff *skb, struct sock *sk)