aboutsummaryrefslogtreecommitdiffstats
path: root/net/atm/common.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/atm/common.c')
-rw-r--r--net/atm/common.c31
1 files changed, 19 insertions, 12 deletions
diff --git a/net/atm/common.c b/net/atm/common.c
index 74d095a081e3..b43feb1a3995 100644
--- a/net/atm/common.c
+++ b/net/atm/common.c
@@ -18,6 +18,7 @@
18#include <linux/skbuff.h> 18#include <linux/skbuff.h>
19#include <linux/bitops.h> 19#include <linux/bitops.h>
20#include <linux/init.h> 20#include <linux/init.h>
21#include <linux/slab.h>
21#include <net/sock.h> /* struct sock */ 22#include <net/sock.h> /* struct sock */
22#include <linux/uaccess.h> 23#include <linux/uaccess.h>
23#include <linux/poll.h> 24#include <linux/poll.h>
@@ -89,10 +90,13 @@ static void vcc_sock_destruct(struct sock *sk)
89 90
90static void vcc_def_wakeup(struct sock *sk) 91static void vcc_def_wakeup(struct sock *sk)
91{ 92{
92 read_lock(&sk->sk_callback_lock); 93 struct socket_wq *wq;
93 if (sk_has_sleeper(sk)) 94
94 wake_up(sk->sk_sleep); 95 rcu_read_lock();
95 read_unlock(&sk->sk_callback_lock); 96 wq = rcu_dereference(sk->sk_wq);
97 if (wq_has_sleeper(wq))
98 wake_up(&wq->wait);
99 rcu_read_unlock();
96} 100}
97 101
98static inline int vcc_writable(struct sock *sk) 102static inline int vcc_writable(struct sock *sk)
@@ -105,16 +109,19 @@ static inline int vcc_writable(struct sock *sk)
105 109
106static void vcc_write_space(struct sock *sk) 110static void vcc_write_space(struct sock *sk)
107{ 111{
108 read_lock(&sk->sk_callback_lock); 112 struct socket_wq *wq;
113
114 rcu_read_lock();
109 115
110 if (vcc_writable(sk)) { 116 if (vcc_writable(sk)) {
111 if (sk_has_sleeper(sk)) 117 wq = rcu_dereference(sk->sk_wq);
112 wake_up_interruptible(sk->sk_sleep); 118 if (wq_has_sleeper(wq))
119 wake_up_interruptible(&wq->wait);
113 120
114 sk_wake_async(sk, SOCK_WAKE_SPACE, POLL_OUT); 121 sk_wake_async(sk, SOCK_WAKE_SPACE, POLL_OUT);
115 } 122 }
116 123
117 read_unlock(&sk->sk_callback_lock); 124 rcu_read_unlock();
118} 125}
119 126
120static struct proto vcc_proto = { 127static struct proto vcc_proto = {
@@ -548,7 +555,7 @@ int vcc_sendmsg(struct kiocb *iocb, struct socket *sock, struct msghdr *m,
548 } 555 }
549 556
550 eff = (size+3) & ~3; /* align to word boundary */ 557 eff = (size+3) & ~3; /* align to word boundary */
551 prepare_to_wait(sk->sk_sleep, &wait, TASK_INTERRUPTIBLE); 558 prepare_to_wait(sk_sleep(sk), &wait, TASK_INTERRUPTIBLE);
552 error = 0; 559 error = 0;
553 while (!(skb = alloc_tx(vcc, eff))) { 560 while (!(skb = alloc_tx(vcc, eff))) {
554 if (m->msg_flags & MSG_DONTWAIT) { 561 if (m->msg_flags & MSG_DONTWAIT) {
@@ -567,9 +574,9 @@ int vcc_sendmsg(struct kiocb *iocb, struct socket *sock, struct msghdr *m,
567 send_sig(SIGPIPE, current, 0); 574 send_sig(SIGPIPE, current, 0);
568 break; 575 break;
569 } 576 }
570 prepare_to_wait(sk->sk_sleep, &wait, TASK_INTERRUPTIBLE); 577 prepare_to_wait(sk_sleep(sk), &wait, TASK_INTERRUPTIBLE);
571 } 578 }
572 finish_wait(sk->sk_sleep, &wait); 579 finish_wait(sk_sleep(sk), &wait);
573 if (error) 580 if (error)
574 goto out; 581 goto out;
575 skb->dev = NULL; /* for paths shared with net_device interfaces */ 582 skb->dev = NULL; /* for paths shared with net_device interfaces */
@@ -594,7 +601,7 @@ unsigned int vcc_poll(struct file *file, struct socket *sock, poll_table *wait)
594 struct atm_vcc *vcc; 601 struct atm_vcc *vcc;
595 unsigned int mask; 602 unsigned int mask;
596 603
597 sock_poll_wait(file, sk->sk_sleep, wait); 604 sock_poll_wait(file, sk_sleep(sk), wait);
598 mask = 0; 605 mask = 0;
599 606
600 vcc = ATM_SD(sock); 607 vcc = ATM_SD(sock);