aboutsummaryrefslogtreecommitdiffstats
path: root/net/x25
diff options
context:
space:
mode:
authorEric Dumazet <eric.dumazet@gmail.com>2010-04-20 09:03:51 -0400
committerDavid S. Miller <davem@davemloft.net>2010-04-20 19:37:13 -0400
commitaa395145165cb06a0d0885221bbe0ce4a564391d (patch)
tree118b0403621f10db8dc3dbf12079f9af5b19e05d /net/x25
parentab9304717f7624c41927f442e6b6d418b2d8b3e4 (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/x25')
-rw-r--r--net/x25/af_x25.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/net/x25/af_x25.c b/net/x25/af_x25.c
index cbddd0cb83f1..6cffbc4da029 100644
--- a/net/x25/af_x25.c
+++ b/net/x25/af_x25.c
@@ -718,7 +718,7 @@ static int x25_wait_for_connection_establishment(struct sock *sk)
718 DECLARE_WAITQUEUE(wait, current); 718 DECLARE_WAITQUEUE(wait, current);
719 int rc; 719 int rc;
720 720
721 add_wait_queue_exclusive(sk->sk_sleep, &wait); 721 add_wait_queue_exclusive(sk_sleep(sk), &wait);
722 for (;;) { 722 for (;;) {
723 __set_current_state(TASK_INTERRUPTIBLE); 723 __set_current_state(TASK_INTERRUPTIBLE);
724 rc = -ERESTARTSYS; 724 rc = -ERESTARTSYS;
@@ -738,7 +738,7 @@ static int x25_wait_for_connection_establishment(struct sock *sk)
738 break; 738 break;
739 } 739 }
740 __set_current_state(TASK_RUNNING); 740 __set_current_state(TASK_RUNNING);
741 remove_wait_queue(sk->sk_sleep, &wait); 741 remove_wait_queue(sk_sleep(sk), &wait);
742 return rc; 742 return rc;
743} 743}
744 744
@@ -838,7 +838,7 @@ static int x25_wait_for_data(struct sock *sk, long timeout)
838 DECLARE_WAITQUEUE(wait, current); 838 DECLARE_WAITQUEUE(wait, current);
839 int rc = 0; 839 int rc = 0;
840 840
841 add_wait_queue_exclusive(sk->sk_sleep, &wait); 841 add_wait_queue_exclusive(sk_sleep(sk), &wait);
842 for (;;) { 842 for (;;) {
843 __set_current_state(TASK_INTERRUPTIBLE); 843 __set_current_state(TASK_INTERRUPTIBLE);
844 if (sk->sk_shutdown & RCV_SHUTDOWN) 844 if (sk->sk_shutdown & RCV_SHUTDOWN)
@@ -858,7 +858,7 @@ static int x25_wait_for_data(struct sock *sk, long timeout)
858 break; 858 break;
859 } 859 }
860 __set_current_state(TASK_RUNNING); 860 __set_current_state(TASK_RUNNING);
861 remove_wait_queue(sk->sk_sleep, &wait); 861 remove_wait_queue(sk_sleep(sk), &wait);
862 return rc; 862 return rc;
863} 863}
864 864