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/rose/af_rose.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/rose/af_rose.c')
-rw-r--r-- | net/rose/af_rose.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/net/rose/af_rose.c b/net/rose/af_rose.c index 4fb711a035f4..8e45e76a95f5 100644 --- a/net/rose/af_rose.c +++ b/net/rose/af_rose.c | |||
@@ -845,7 +845,7 @@ rose_try_next_neigh: | |||
845 | DEFINE_WAIT(wait); | 845 | DEFINE_WAIT(wait); |
846 | 846 | ||
847 | for (;;) { | 847 | for (;;) { |
848 | prepare_to_wait(sk->sk_sleep, &wait, | 848 | prepare_to_wait(sk_sleep(sk), &wait, |
849 | TASK_INTERRUPTIBLE); | 849 | TASK_INTERRUPTIBLE); |
850 | if (sk->sk_state != TCP_SYN_SENT) | 850 | if (sk->sk_state != TCP_SYN_SENT) |
851 | break; | 851 | break; |
@@ -858,7 +858,7 @@ rose_try_next_neigh: | |||
858 | err = -ERESTARTSYS; | 858 | err = -ERESTARTSYS; |
859 | break; | 859 | break; |
860 | } | 860 | } |
861 | finish_wait(sk->sk_sleep, &wait); | 861 | finish_wait(sk_sleep(sk), &wait); |
862 | 862 | ||
863 | if (err) | 863 | if (err) |
864 | goto out_release; | 864 | goto out_release; |
@@ -911,7 +911,7 @@ static int rose_accept(struct socket *sock, struct socket *newsock, int flags) | |||
911 | * hooked into the SABM we saved | 911 | * hooked into the SABM we saved |
912 | */ | 912 | */ |
913 | for (;;) { | 913 | for (;;) { |
914 | prepare_to_wait(sk->sk_sleep, &wait, TASK_INTERRUPTIBLE); | 914 | prepare_to_wait(sk_sleep(sk), &wait, TASK_INTERRUPTIBLE); |
915 | 915 | ||
916 | skb = skb_dequeue(&sk->sk_receive_queue); | 916 | skb = skb_dequeue(&sk->sk_receive_queue); |
917 | if (skb) | 917 | if (skb) |
@@ -930,7 +930,7 @@ static int rose_accept(struct socket *sock, struct socket *newsock, int flags) | |||
930 | err = -ERESTARTSYS; | 930 | err = -ERESTARTSYS; |
931 | break; | 931 | break; |
932 | } | 932 | } |
933 | finish_wait(sk->sk_sleep, &wait); | 933 | finish_wait(sk_sleep(sk), &wait); |
934 | if (err) | 934 | if (err) |
935 | goto out_release; | 935 | goto out_release; |
936 | 936 | ||