aboutsummaryrefslogtreecommitdiffstats
path: root/net/sunrpc
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/sunrpc
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/sunrpc')
-rw-r--r--net/sunrpc/svcsock.c24
1 files changed, 12 insertions, 12 deletions
diff --git a/net/sunrpc/svcsock.c b/net/sunrpc/svcsock.c
index a29f259204e6..ce0d5b35c2ac 100644
--- a/net/sunrpc/svcsock.c
+++ b/net/sunrpc/svcsock.c
@@ -419,8 +419,8 @@ static void svc_udp_data_ready(struct sock *sk, int count)
419 set_bit(XPT_DATA, &svsk->sk_xprt.xpt_flags); 419 set_bit(XPT_DATA, &svsk->sk_xprt.xpt_flags);
420 svc_xprt_enqueue(&svsk->sk_xprt); 420 svc_xprt_enqueue(&svsk->sk_xprt);
421 } 421 }
422 if (sk->sk_sleep && waitqueue_active(sk->sk_sleep)) 422 if (sk_sleep(sk) && waitqueue_active(sk_sleep(sk)))
423 wake_up_interruptible(sk->sk_sleep); 423 wake_up_interruptible(sk_sleep(sk));
424} 424}
425 425
426/* 426/*
@@ -436,10 +436,10 @@ static void svc_write_space(struct sock *sk)
436 svc_xprt_enqueue(&svsk->sk_xprt); 436 svc_xprt_enqueue(&svsk->sk_xprt);
437 } 437 }
438 438
439 if (sk->sk_sleep && waitqueue_active(sk->sk_sleep)) { 439 if (sk_sleep(sk) && waitqueue_active(sk_sleep(sk))) {
440 dprintk("RPC svc_write_space: someone sleeping on %p\n", 440 dprintk("RPC svc_write_space: someone sleeping on %p\n",
441 svsk); 441 svsk);
442 wake_up_interruptible(sk->sk_sleep); 442 wake_up_interruptible(sk_sleep(sk));
443 } 443 }
444} 444}
445 445
@@ -757,8 +757,8 @@ static void svc_tcp_listen_data_ready(struct sock *sk, int count_unused)
757 printk("svc: socket %p: no user data\n", sk); 757 printk("svc: socket %p: no user data\n", sk);
758 } 758 }
759 759
760 if (sk->sk_sleep && waitqueue_active(sk->sk_sleep)) 760 if (sk_sleep(sk) && waitqueue_active(sk_sleep(sk)))
761 wake_up_interruptible_all(sk->sk_sleep); 761 wake_up_interruptible_all(sk_sleep(sk));
762} 762}
763 763
764/* 764/*
@@ -777,8 +777,8 @@ static void svc_tcp_state_change(struct sock *sk)
777 set_bit(XPT_CLOSE, &svsk->sk_xprt.xpt_flags); 777 set_bit(XPT_CLOSE, &svsk->sk_xprt.xpt_flags);
778 svc_xprt_enqueue(&svsk->sk_xprt); 778 svc_xprt_enqueue(&svsk->sk_xprt);
779 } 779 }
780 if (sk->sk_sleep && waitqueue_active(sk->sk_sleep)) 780 if (sk_sleep(sk) && waitqueue_active(sk_sleep(sk)))
781 wake_up_interruptible_all(sk->sk_sleep); 781 wake_up_interruptible_all(sk_sleep(sk));
782} 782}
783 783
784static void svc_tcp_data_ready(struct sock *sk, int count) 784static void svc_tcp_data_ready(struct sock *sk, int count)
@@ -791,8 +791,8 @@ static void svc_tcp_data_ready(struct sock *sk, int count)
791 set_bit(XPT_DATA, &svsk->sk_xprt.xpt_flags); 791 set_bit(XPT_DATA, &svsk->sk_xprt.xpt_flags);
792 svc_xprt_enqueue(&svsk->sk_xprt); 792 svc_xprt_enqueue(&svsk->sk_xprt);
793 } 793 }
794 if (sk->sk_sleep && waitqueue_active(sk->sk_sleep)) 794 if (sk_sleep(sk) && waitqueue_active(sk_sleep(sk)))
795 wake_up_interruptible(sk->sk_sleep); 795 wake_up_interruptible(sk_sleep(sk));
796} 796}
797 797
798/* 798/*
@@ -1494,8 +1494,8 @@ static void svc_sock_detach(struct svc_xprt *xprt)
1494 sk->sk_data_ready = svsk->sk_odata; 1494 sk->sk_data_ready = svsk->sk_odata;
1495 sk->sk_write_space = svsk->sk_owspace; 1495 sk->sk_write_space = svsk->sk_owspace;
1496 1496
1497 if (sk->sk_sleep && waitqueue_active(sk->sk_sleep)) 1497 if (sk_sleep(sk) && waitqueue_active(sk_sleep(sk)))
1498 wake_up_interruptible(sk->sk_sleep); 1498 wake_up_interruptible(sk_sleep(sk));
1499} 1499}
1500 1500
1501/* 1501/*