aboutsummaryrefslogtreecommitdiffstats
path: root/net/atm/common.c
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/atm/common.c
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/atm/common.c')
-rw-r--r--net/atm/common.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/net/atm/common.c b/net/atm/common.c
index 97ed94aa0cbc..e3e10e6f8628 100644
--- a/net/atm/common.c
+++ b/net/atm/common.c
@@ -92,7 +92,7 @@ static void vcc_def_wakeup(struct sock *sk)
92{ 92{
93 read_lock(&sk->sk_callback_lock); 93 read_lock(&sk->sk_callback_lock);
94 if (sk_has_sleeper(sk)) 94 if (sk_has_sleeper(sk))
95 wake_up(sk->sk_sleep); 95 wake_up(sk_sleep(sk));
96 read_unlock(&sk->sk_callback_lock); 96 read_unlock(&sk->sk_callback_lock);
97} 97}
98 98
@@ -110,7 +110,7 @@ static void vcc_write_space(struct sock *sk)
110 110
111 if (vcc_writable(sk)) { 111 if (vcc_writable(sk)) {
112 if (sk_has_sleeper(sk)) 112 if (sk_has_sleeper(sk))
113 wake_up_interruptible(sk->sk_sleep); 113 wake_up_interruptible(sk_sleep(sk));
114 114
115 sk_wake_async(sk, SOCK_WAKE_SPACE, POLL_OUT); 115 sk_wake_async(sk, SOCK_WAKE_SPACE, POLL_OUT);
116 } 116 }
@@ -549,7 +549,7 @@ int vcc_sendmsg(struct kiocb *iocb, struct socket *sock, struct msghdr *m,
549 } 549 }
550 550
551 eff = (size+3) & ~3; /* align to word boundary */ 551 eff = (size+3) & ~3; /* align to word boundary */
552 prepare_to_wait(sk->sk_sleep, &wait, TASK_INTERRUPTIBLE); 552 prepare_to_wait(sk_sleep(sk), &wait, TASK_INTERRUPTIBLE);
553 error = 0; 553 error = 0;
554 while (!(skb = alloc_tx(vcc, eff))) { 554 while (!(skb = alloc_tx(vcc, eff))) {
555 if (m->msg_flags & MSG_DONTWAIT) { 555 if (m->msg_flags & MSG_DONTWAIT) {
@@ -568,9 +568,9 @@ int vcc_sendmsg(struct kiocb *iocb, struct socket *sock, struct msghdr *m,
568 send_sig(SIGPIPE, current, 0); 568 send_sig(SIGPIPE, current, 0);
569 break; 569 break;
570 } 570 }
571 prepare_to_wait(sk->sk_sleep, &wait, TASK_INTERRUPTIBLE); 571 prepare_to_wait(sk_sleep(sk), &wait, TASK_INTERRUPTIBLE);
572 } 572 }
573 finish_wait(sk->sk_sleep, &wait); 573 finish_wait(sk_sleep(sk), &wait);
574 if (error) 574 if (error)
575 goto out; 575 goto out;
576 skb->dev = NULL; /* for paths shared with net_device interfaces */ 576 skb->dev = NULL; /* for paths shared with net_device interfaces */
@@ -595,7 +595,7 @@ unsigned int vcc_poll(struct file *file, struct socket *sock, poll_table *wait)
595 struct atm_vcc *vcc; 595 struct atm_vcc *vcc;
596 unsigned int mask; 596 unsigned int mask;
597 597
598 sock_poll_wait(file, sk->sk_sleep, wait); 598 sock_poll_wait(file, sk_sleep(sk), wait);
599 mask = 0; 599 mask = 0;
600 600
601 vcc = ATM_SD(sock); 601 vcc = ATM_SD(sock);