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/iucv/af_iucv.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/iucv/af_iucv.c')
-rw-r--r-- | net/iucv/af_iucv.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/net/iucv/af_iucv.c b/net/iucv/af_iucv.c index c18286a2167b..9636b7d27b48 100644 --- a/net/iucv/af_iucv.c +++ b/net/iucv/af_iucv.c | |||
@@ -59,7 +59,7 @@ do { \ | |||
59 | DEFINE_WAIT(__wait); \ | 59 | DEFINE_WAIT(__wait); \ |
60 | long __timeo = timeo; \ | 60 | long __timeo = timeo; \ |
61 | ret = 0; \ | 61 | ret = 0; \ |
62 | prepare_to_wait(sk->sk_sleep, &__wait, TASK_INTERRUPTIBLE); \ | 62 | prepare_to_wait(sk_sleep(sk), &__wait, TASK_INTERRUPTIBLE); \ |
63 | while (!(condition)) { \ | 63 | while (!(condition)) { \ |
64 | if (!__timeo) { \ | 64 | if (!__timeo) { \ |
65 | ret = -EAGAIN; \ | 65 | ret = -EAGAIN; \ |
@@ -76,7 +76,7 @@ do { \ | |||
76 | if (ret) \ | 76 | if (ret) \ |
77 | break; \ | 77 | break; \ |
78 | } \ | 78 | } \ |
79 | finish_wait(sk->sk_sleep, &__wait); \ | 79 | finish_wait(sk_sleep(sk), &__wait); \ |
80 | } while (0) | 80 | } while (0) |
81 | 81 | ||
82 | #define iucv_sock_wait(sk, condition, timeo) \ | 82 | #define iucv_sock_wait(sk, condition, timeo) \ |
@@ -307,7 +307,7 @@ static void iucv_sock_wake_msglim(struct sock *sk) | |||
307 | { | 307 | { |
308 | read_lock(&sk->sk_callback_lock); | 308 | read_lock(&sk->sk_callback_lock); |
309 | if (sk_has_sleeper(sk)) | 309 | if (sk_has_sleeper(sk)) |
310 | wake_up_interruptible_all(sk->sk_sleep); | 310 | wake_up_interruptible_all(sk_sleep(sk)); |
311 | sk_wake_async(sk, SOCK_WAKE_SPACE, POLL_OUT); | 311 | sk_wake_async(sk, SOCK_WAKE_SPACE, POLL_OUT); |
312 | read_unlock(&sk->sk_callback_lock); | 312 | read_unlock(&sk->sk_callback_lock); |
313 | } | 313 | } |
@@ -795,7 +795,7 @@ static int iucv_sock_accept(struct socket *sock, struct socket *newsock, | |||
795 | timeo = sock_rcvtimeo(sk, flags & O_NONBLOCK); | 795 | timeo = sock_rcvtimeo(sk, flags & O_NONBLOCK); |
796 | 796 | ||
797 | /* Wait for an incoming connection */ | 797 | /* Wait for an incoming connection */ |
798 | add_wait_queue_exclusive(sk->sk_sleep, &wait); | 798 | add_wait_queue_exclusive(sk_sleep(sk), &wait); |
799 | while (!(nsk = iucv_accept_dequeue(sk, newsock))) { | 799 | while (!(nsk = iucv_accept_dequeue(sk, newsock))) { |
800 | set_current_state(TASK_INTERRUPTIBLE); | 800 | set_current_state(TASK_INTERRUPTIBLE); |
801 | if (!timeo) { | 801 | if (!timeo) { |
@@ -819,7 +819,7 @@ static int iucv_sock_accept(struct socket *sock, struct socket *newsock, | |||
819 | } | 819 | } |
820 | 820 | ||
821 | set_current_state(TASK_RUNNING); | 821 | set_current_state(TASK_RUNNING); |
822 | remove_wait_queue(sk->sk_sleep, &wait); | 822 | remove_wait_queue(sk_sleep(sk), &wait); |
823 | 823 | ||
824 | if (err) | 824 | if (err) |
825 | goto done; | 825 | goto done; |
@@ -1269,7 +1269,7 @@ unsigned int iucv_sock_poll(struct file *file, struct socket *sock, | |||
1269 | struct sock *sk = sock->sk; | 1269 | struct sock *sk = sock->sk; |
1270 | unsigned int mask = 0; | 1270 | unsigned int mask = 0; |
1271 | 1271 | ||
1272 | sock_poll_wait(file, sk->sk_sleep, wait); | 1272 | sock_poll_wait(file, sk_sleep(sk), wait); |
1273 | 1273 | ||
1274 | if (sk->sk_state == IUCV_LISTEN) | 1274 | if (sk->sk_state == IUCV_LISTEN) |
1275 | return iucv_accept_poll(sk); | 1275 | return iucv_accept_poll(sk); |