diff options
author | Eric Dumazet <eric.dumazet@gmail.com> | 2010-04-20 09:03:51 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-04-20 19:37:13 -0400 |
commit | aa395145165cb06a0d0885221bbe0ce4a564391d (patch) | |
tree | 118b0403621f10db8dc3dbf12079f9af5b19e05d /net/sctp/socket.c | |
parent | ab9304717f7624c41927f442e6b6d418b2d8b3e4 (diff) |
net: sk_sleep() helper
Define a new function to return the waitqueue of a "struct sock".
static inline wait_queue_head_t *sk_sleep(struct sock *sk)
{
return sk->sk_sleep;
}
Change all read occurrences of sk_sleep by a call to this function.
Needed for a future RCU conversion. sk_sleep wont be a field directly
available.
Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/sctp/socket.c')
-rw-r--r-- | net/sctp/socket.c | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/net/sctp/socket.c b/net/sctp/socket.c index c1941276f6e3..f34adcca8a8c 100644 --- a/net/sctp/socket.c +++ b/net/sctp/socket.c | |||
@@ -5702,7 +5702,7 @@ unsigned int sctp_poll(struct file *file, struct socket *sock, poll_table *wait) | |||
5702 | struct sctp_sock *sp = sctp_sk(sk); | 5702 | struct sctp_sock *sp = sctp_sk(sk); |
5703 | unsigned int mask; | 5703 | unsigned int mask; |
5704 | 5704 | ||
5705 | poll_wait(file, sk->sk_sleep, wait); | 5705 | poll_wait(file, sk_sleep(sk), wait); |
5706 | 5706 | ||
5707 | /* A TCP-style listening socket becomes readable when the accept queue | 5707 | /* A TCP-style listening socket becomes readable when the accept queue |
5708 | * is not empty. | 5708 | * is not empty. |
@@ -5943,7 +5943,7 @@ static int sctp_wait_for_packet(struct sock * sk, int *err, long *timeo_p) | |||
5943 | int error; | 5943 | int error; |
5944 | DEFINE_WAIT(wait); | 5944 | DEFINE_WAIT(wait); |
5945 | 5945 | ||
5946 | prepare_to_wait_exclusive(sk->sk_sleep, &wait, TASK_INTERRUPTIBLE); | 5946 | prepare_to_wait_exclusive(sk_sleep(sk), &wait, TASK_INTERRUPTIBLE); |
5947 | 5947 | ||
5948 | /* Socket errors? */ | 5948 | /* Socket errors? */ |
5949 | error = sock_error(sk); | 5949 | error = sock_error(sk); |
@@ -5980,14 +5980,14 @@ static int sctp_wait_for_packet(struct sock * sk, int *err, long *timeo_p) | |||
5980 | sctp_lock_sock(sk); | 5980 | sctp_lock_sock(sk); |
5981 | 5981 | ||
5982 | ready: | 5982 | ready: |
5983 | finish_wait(sk->sk_sleep, &wait); | 5983 | finish_wait(sk_sleep(sk), &wait); |
5984 | return 0; | 5984 | return 0; |
5985 | 5985 | ||
5986 | interrupted: | 5986 | interrupted: |
5987 | error = sock_intr_errno(*timeo_p); | 5987 | error = sock_intr_errno(*timeo_p); |
5988 | 5988 | ||
5989 | out: | 5989 | out: |
5990 | finish_wait(sk->sk_sleep, &wait); | 5990 | finish_wait(sk_sleep(sk), &wait); |
5991 | *err = error; | 5991 | *err = error; |
5992 | return error; | 5992 | return error; |
5993 | } | 5993 | } |
@@ -6061,8 +6061,8 @@ static void __sctp_write_space(struct sctp_association *asoc) | |||
6061 | wake_up_interruptible(&asoc->wait); | 6061 | wake_up_interruptible(&asoc->wait); |
6062 | 6062 | ||
6063 | if (sctp_writeable(sk)) { | 6063 | if (sctp_writeable(sk)) { |
6064 | if (sk->sk_sleep && waitqueue_active(sk->sk_sleep)) | 6064 | if (sk_sleep(sk) && waitqueue_active(sk_sleep(sk))) |
6065 | wake_up_interruptible(sk->sk_sleep); | 6065 | wake_up_interruptible(sk_sleep(sk)); |
6066 | 6066 | ||
6067 | /* Note that we try to include the Async I/O support | 6067 | /* Note that we try to include the Async I/O support |
6068 | * here by modeling from the current TCP/UDP code. | 6068 | * here by modeling from the current TCP/UDP code. |
@@ -6296,7 +6296,7 @@ static int sctp_wait_for_accept(struct sock *sk, long timeo) | |||
6296 | 6296 | ||
6297 | 6297 | ||
6298 | for (;;) { | 6298 | for (;;) { |
6299 | prepare_to_wait_exclusive(sk->sk_sleep, &wait, | 6299 | prepare_to_wait_exclusive(sk_sleep(sk), &wait, |
6300 | TASK_INTERRUPTIBLE); | 6300 | TASK_INTERRUPTIBLE); |
6301 | 6301 | ||
6302 | if (list_empty(&ep->asocs)) { | 6302 | if (list_empty(&ep->asocs)) { |
@@ -6322,7 +6322,7 @@ static int sctp_wait_for_accept(struct sock *sk, long timeo) | |||
6322 | break; | 6322 | break; |
6323 | } | 6323 | } |
6324 | 6324 | ||
6325 | finish_wait(sk->sk_sleep, &wait); | 6325 | finish_wait(sk_sleep(sk), &wait); |
6326 | 6326 | ||
6327 | return err; | 6327 | return err; |
6328 | } | 6328 | } |
@@ -6332,7 +6332,7 @@ static void sctp_wait_for_close(struct sock *sk, long timeout) | |||
6332 | DEFINE_WAIT(wait); | 6332 | DEFINE_WAIT(wait); |
6333 | 6333 | ||
6334 | do { | 6334 | do { |
6335 | prepare_to_wait(sk->sk_sleep, &wait, TASK_INTERRUPTIBLE); | 6335 | prepare_to_wait(sk_sleep(sk), &wait, TASK_INTERRUPTIBLE); |
6336 | if (list_empty(&sctp_sk(sk)->ep->asocs)) | 6336 | if (list_empty(&sctp_sk(sk)->ep->asocs)) |
6337 | break; | 6337 | break; |
6338 | sctp_release_sock(sk); | 6338 | sctp_release_sock(sk); |
@@ -6340,7 +6340,7 @@ static void sctp_wait_for_close(struct sock *sk, long timeout) | |||
6340 | sctp_lock_sock(sk); | 6340 | sctp_lock_sock(sk); |
6341 | } while (!signal_pending(current) && timeout); | 6341 | } while (!signal_pending(current) && timeout); |
6342 | 6342 | ||
6343 | finish_wait(sk->sk_sleep, &wait); | 6343 | finish_wait(sk_sleep(sk), &wait); |
6344 | } | 6344 | } |
6345 | 6345 | ||
6346 | static void sctp_skb_set_owner_r_frag(struct sk_buff *skb, struct sock *sk) | 6346 | static void sctp_skb_set_owner_r_frag(struct sk_buff *skb, struct sock *sk) |