Commit aa395145165cb06a0d0885221bbe0ce4a564391d

Authored by Eric Dumazet
Committed by David S. Miller
1 parent ab9304717f

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>

Showing 46 changed files with 208 additions and 204 deletions Side-by-side Diff

drivers/atm/atmtcp.c
... ... @@ -68,7 +68,7 @@
68 68 *(struct atm_vcc **) &new_msg->vcc = vcc;
69 69 old_test = test_bit(flag,&vcc->flags);
70 70 out_vcc->push(out_vcc,skb);
71   - add_wait_queue(sk_atm(vcc)->sk_sleep, &wait);
  71 + add_wait_queue(sk_sleep(sk_atm(vcc)), &wait);
72 72 while (test_bit(flag,&vcc->flags) == old_test) {
73 73 mb();
74 74 out_vcc = PRIV(vcc->dev) ? PRIV(vcc->dev)->vcc : NULL;
... ... @@ -80,7 +80,7 @@
80 80 schedule();
81 81 }
82 82 set_current_state(TASK_RUNNING);
83   - remove_wait_queue(sk_atm(vcc)->sk_sleep, &wait);
  83 + remove_wait_queue(sk_sleep(sk_atm(vcc)), &wait);
84 84 return error;
85 85 }
86 86  
... ... @@ -105,7 +105,7 @@
105 105 msg->type);
106 106 return -EINVAL;
107 107 }
108   - wake_up(sk_atm(vcc)->sk_sleep);
  108 + wake_up(sk_sleep(sk_atm(vcc)));
109 109 return 0;
110 110 }
111 111  
drivers/net/macvtap.c
... ... @@ -246,8 +246,8 @@
246 246 !test_and_clear_bit(SOCK_ASYNC_NOSPACE, &sk->sk_socket->flags))
247 247 return;
248 248  
249   - if (sk->sk_sleep && waitqueue_active(sk->sk_sleep))
250   - wake_up_interruptible_poll(sk->sk_sleep, POLLOUT | POLLWRNORM | POLLWRBAND);
  249 + if (sk_sleep(sk) && waitqueue_active(sk_sleep(sk)))
  250 + wake_up_interruptible_poll(sk_sleep(sk), POLLOUT | POLLWRNORM | POLLWRBAND);
251 251 }
252 252  
253 253 static int macvtap_open(struct inode *inode, struct file *file)
... ... @@ -868,8 +868,8 @@
868 868 if (!test_and_clear_bit(SOCK_ASYNC_NOSPACE, &sk->sk_socket->flags))
869 869 return;
870 870  
871   - if (sk->sk_sleep && waitqueue_active(sk->sk_sleep))
872   - wake_up_interruptible_sync_poll(sk->sk_sleep, POLLOUT |
  871 + if (sk_sleep(sk) && waitqueue_active(sk_sleep(sk)))
  872 + wake_up_interruptible_sync_poll(sk_sleep(sk), POLLOUT |
873 873 POLLWRNORM | POLLWRBAND);
874 874  
875 875 tun = tun_sk(sk)->tun;
drivers/scsi/iscsi_tcp.c
... ... @@ -599,9 +599,9 @@
599 599 set_bit(ISCSI_SUSPEND_BIT, &conn->suspend_rx);
600 600 write_unlock_bh(&tcp_sw_conn->sock->sk->sk_callback_lock);
601 601  
602   - if (sock->sk->sk_sleep && waitqueue_active(sock->sk->sk_sleep)) {
  602 + if (sk_sleep(sock->sk) && waitqueue_active(sk_sleep(sock->sk))) {
603 603 sock->sk->sk_err = EIO;
604   - wake_up_interruptible(sock->sk->sk_sleep);
  604 + wake_up_interruptible(sk_sleep(sock->sk));
605 605 }
606 606  
607 607 iscsi_conn_stop(cls_conn, flag);
... ... @@ -1160,6 +1160,10 @@
1160 1160 sk->sk_socket = sock;
1161 1161 }
1162 1162  
  1163 +static inline wait_queue_head_t *sk_sleep(struct sock *sk)
  1164 +{
  1165 + return sk->sk_sleep;
  1166 +}
1163 1167 /* Detach socket from process context.
1164 1168 * Announce socket dead, detach it from wait queue and inode.
1165 1169 * Note that parent inode held reference count on this struct sock,
... ... @@ -1346,8 +1350,8 @@
1346 1350 * tp->rcv_nxt check sock_def_readable
1347 1351 * ... {
1348 1352 * schedule ...
1349   - * if (sk->sk_sleep && waitqueue_active(sk->sk_sleep))
1350   - * wake_up_interruptible(sk->sk_sleep)
  1353 + * if (sk_sleep(sk) && waitqueue_active(sk_sleep(sk)))
  1354 + * wake_up_interruptible(sk_sleep(sk))
1351 1355 * ...
1352 1356 * }
1353 1357 *
... ... @@ -1368,7 +1372,7 @@
1368 1372 * This memory barrier is paired in the sock_poll_wait.
1369 1373 */
1370 1374 smp_mb__after_lock();
1371   - return sk->sk_sleep && waitqueue_active(sk->sk_sleep);
  1375 + return sk_sleep(sk) && waitqueue_active(sk_sleep(sk));
1372 1376 }
1373 1377  
1374 1378 /**
... ... @@ -939,7 +939,7 @@
939 939  
940 940 tp->ucopy.memory = 0;
941 941 } else if (skb_queue_len(&tp->ucopy.prequeue) == 1) {
942   - wake_up_interruptible_sync_poll(sk->sk_sleep,
  942 + wake_up_interruptible_sync_poll(sk_sleep(sk),
943 943 POLLIN | POLLRDNORM | POLLRDBAND);
944 944 if (!inet_csk_ack_scheduled(sk))
945 945 inet_csk_reset_xmit_timer(sk, ICSK_TIME_DACK,
... ... @@ -92,7 +92,7 @@
92 92 {
93 93 read_lock(&sk->sk_callback_lock);
94 94 if (sk_has_sleeper(sk))
95   - wake_up(sk->sk_sleep);
  95 + wake_up(sk_sleep(sk));
96 96 read_unlock(&sk->sk_callback_lock);
97 97 }
98 98  
... ... @@ -110,7 +110,7 @@
110 110  
111 111 if (vcc_writable(sk)) {
112 112 if (sk_has_sleeper(sk))
113   - wake_up_interruptible(sk->sk_sleep);
  113 + wake_up_interruptible(sk_sleep(sk));
114 114  
115 115 sk_wake_async(sk, SOCK_WAKE_SPACE, POLL_OUT);
116 116 }
... ... @@ -549,7 +549,7 @@
549 549 }
550 550  
551 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 553 error = 0;
554 554 while (!(skb = alloc_tx(vcc, eff))) {
555 555 if (m->msg_flags & MSG_DONTWAIT) {
556 556  
... ... @@ -568,9 +568,9 @@
568 568 send_sig(SIGPIPE, current, 0);
569 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 574 if (error)
575 575 goto out;
576 576 skb->dev = NULL; /* for paths shared with net_device interfaces */
... ... @@ -595,7 +595,7 @@
595 595 struct atm_vcc *vcc;
596 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 599 mask = 0;
600 600  
601 601 vcc = ATM_SD(sock);
... ... @@ -131,7 +131,7 @@
131 131 }
132 132 sk->sk_ack_backlog++;
133 133 skb_queue_tail(&sk->sk_receive_queue, skb);
134   - pr_debug("waking sk->sk_sleep 0x%p\n", sk->sk_sleep);
  134 + pr_debug("waking sk_sleep(sk) 0x%p\n", sk_sleep(sk));
135 135 sk->sk_state_change(sk);
136 136 as_indicate_complete:
137 137 release_sock(sk);
... ... @@ -49,14 +49,14 @@
49 49  
50 50 pr_debug("%p\n", vcc);
51 51 if (test_bit(ATM_VF_REGIS, &vcc->flags)) {
52   - prepare_to_wait(sk->sk_sleep, &wait, TASK_UNINTERRUPTIBLE);
  52 + prepare_to_wait(sk_sleep(sk), &wait, TASK_UNINTERRUPTIBLE);
53 53 sigd_enq(vcc, as_close, NULL, NULL, NULL);
54 54 while (!test_bit(ATM_VF_RELEASED, &vcc->flags) && sigd) {
55 55 schedule();
56   - prepare_to_wait(sk->sk_sleep, &wait,
  56 + prepare_to_wait(sk_sleep(sk), &wait,
57 57 TASK_UNINTERRUPTIBLE);
58 58 }
59   - finish_wait(sk->sk_sleep, &wait);
  59 + finish_wait(sk_sleep(sk), &wait);
60 60 }
61 61 /* beware - socket is still in use by atmsigd until the last
62 62 as_indicate has been answered */
63 63  
64 64  
... ... @@ -125,13 +125,13 @@
125 125 }
126 126 vcc->local = *addr;
127 127 set_bit(ATM_VF_WAITING, &vcc->flags);
128   - prepare_to_wait(sk->sk_sleep, &wait, TASK_UNINTERRUPTIBLE);
  128 + prepare_to_wait(sk_sleep(sk), &wait, TASK_UNINTERRUPTIBLE);
129 129 sigd_enq(vcc, as_bind, NULL, NULL, &vcc->local);
130 130 while (test_bit(ATM_VF_WAITING, &vcc->flags) && sigd) {
131 131 schedule();
132   - prepare_to_wait(sk->sk_sleep, &wait, TASK_UNINTERRUPTIBLE);
  132 + prepare_to_wait(sk_sleep(sk), &wait, TASK_UNINTERRUPTIBLE);
133 133 }
134   - finish_wait(sk->sk_sleep, &wait);
  134 + finish_wait(sk_sleep(sk), &wait);
135 135 clear_bit(ATM_VF_REGIS, &vcc->flags); /* doesn't count */
136 136 if (!sigd) {
137 137 error = -EUNATCH;
138 138  
... ... @@ -201,10 +201,10 @@
201 201 }
202 202 vcc->remote = *addr;
203 203 set_bit(ATM_VF_WAITING, &vcc->flags);
204   - prepare_to_wait(sk->sk_sleep, &wait, TASK_INTERRUPTIBLE);
  204 + prepare_to_wait(sk_sleep(sk), &wait, TASK_INTERRUPTIBLE);
205 205 sigd_enq(vcc, as_connect, NULL, NULL, &vcc->remote);
206 206 if (flags & O_NONBLOCK) {
207   - finish_wait(sk->sk_sleep, &wait);
  207 + finish_wait(sk_sleep(sk), &wait);
208 208 sock->state = SS_CONNECTING;
209 209 error = -EINPROGRESS;
210 210 goto out;
... ... @@ -213,7 +213,7 @@
213 213 while (test_bit(ATM_VF_WAITING, &vcc->flags) && sigd) {
214 214 schedule();
215 215 if (!signal_pending(current)) {
216   - prepare_to_wait(sk->sk_sleep, &wait,
  216 + prepare_to_wait(sk_sleep(sk), &wait,
217 217 TASK_INTERRUPTIBLE);
218 218 continue;
219 219 }
220 220  
... ... @@ -232,14 +232,14 @@
232 232 */
233 233 sigd_enq(vcc, as_close, NULL, NULL, NULL);
234 234 while (test_bit(ATM_VF_WAITING, &vcc->flags) && sigd) {
235   - prepare_to_wait(sk->sk_sleep, &wait,
  235 + prepare_to_wait(sk_sleep(sk), &wait,
236 236 TASK_INTERRUPTIBLE);
237 237 schedule();
238 238 }
239 239 if (!sk->sk_err)
240 240 while (!test_bit(ATM_VF_RELEASED, &vcc->flags) &&
241 241 sigd) {
242   - prepare_to_wait(sk->sk_sleep, &wait,
  242 + prepare_to_wait(sk_sleep(sk), &wait,
243 243 TASK_INTERRUPTIBLE);
244 244 schedule();
245 245 }
... ... @@ -250,7 +250,7 @@
250 250 error = -EINTR;
251 251 break;
252 252 }
253   - finish_wait(sk->sk_sleep, &wait);
  253 + finish_wait(sk_sleep(sk), &wait);
254 254 if (error)
255 255 goto out;
256 256 if (!sigd) {
257 257  
258 258  
... ... @@ -302,13 +302,13 @@
302 302 goto out;
303 303 }
304 304 set_bit(ATM_VF_WAITING, &vcc->flags);
305   - prepare_to_wait(sk->sk_sleep, &wait, TASK_UNINTERRUPTIBLE);
  305 + prepare_to_wait(sk_sleep(sk), &wait, TASK_UNINTERRUPTIBLE);
306 306 sigd_enq(vcc, as_listen, NULL, NULL, &vcc->local);
307 307 while (test_bit(ATM_VF_WAITING, &vcc->flags) && sigd) {
308 308 schedule();
309   - prepare_to_wait(sk->sk_sleep, &wait, TASK_UNINTERRUPTIBLE);
  309 + prepare_to_wait(sk_sleep(sk), &wait, TASK_UNINTERRUPTIBLE);
310 310 }
311   - finish_wait(sk->sk_sleep, &wait);
  311 + finish_wait(sk_sleep(sk), &wait);
312 312 if (!sigd) {
313 313 error = -EUNATCH;
314 314 goto out;
... ... @@ -343,7 +343,7 @@
343 343 while (1) {
344 344 DEFINE_WAIT(wait);
345 345  
346   - prepare_to_wait(sk->sk_sleep, &wait, TASK_INTERRUPTIBLE);
  346 + prepare_to_wait(sk_sleep(sk), &wait, TASK_INTERRUPTIBLE);
347 347 while (!(skb = skb_dequeue(&sk->sk_receive_queue)) &&
348 348 sigd) {
349 349 if (test_bit(ATM_VF_RELEASED, &old_vcc->flags))
350 350  
... ... @@ -363,10 +363,10 @@
363 363 error = -ERESTARTSYS;
364 364 break;
365 365 }
366   - prepare_to_wait(sk->sk_sleep, &wait,
  366 + prepare_to_wait(sk_sleep(sk), &wait,
367 367 TASK_INTERRUPTIBLE);
368 368 }
369   - finish_wait(sk->sk_sleep, &wait);
  369 + finish_wait(sk_sleep(sk), &wait);
370 370 if (error)
371 371 goto out;
372 372 if (!skb) {
373 373  
374 374  
... ... @@ -392,17 +392,17 @@
392 392 }
393 393 /* wait should be short, so we ignore the non-blocking flag */
394 394 set_bit(ATM_VF_WAITING, &new_vcc->flags);
395   - prepare_to_wait(sk_atm(new_vcc)->sk_sleep, &wait,
  395 + prepare_to_wait(sk_sleep(sk_atm(new_vcc)), &wait,
396 396 TASK_UNINTERRUPTIBLE);
397 397 sigd_enq(new_vcc, as_accept, old_vcc, NULL, NULL);
398 398 while (test_bit(ATM_VF_WAITING, &new_vcc->flags) && sigd) {
399 399 release_sock(sk);
400 400 schedule();
401 401 lock_sock(sk);
402   - prepare_to_wait(sk_atm(new_vcc)->sk_sleep, &wait,
  402 + prepare_to_wait(sk_sleep(sk_atm(new_vcc)), &wait,
403 403 TASK_UNINTERRUPTIBLE);
404 404 }
405   - finish_wait(sk_atm(new_vcc)->sk_sleep, &wait);
  405 + finish_wait(sk_sleep(sk_atm(new_vcc)), &wait);
406 406 if (!sigd) {
407 407 error = -EUNATCH;
408 408 goto out;
409 409  
410 410  
... ... @@ -438,14 +438,14 @@
438 438 DEFINE_WAIT(wait);
439 439  
440 440 set_bit(ATM_VF_WAITING, &vcc->flags);
441   - prepare_to_wait(sk->sk_sleep, &wait, TASK_UNINTERRUPTIBLE);
  441 + prepare_to_wait(sk_sleep(sk), &wait, TASK_UNINTERRUPTIBLE);
442 442 sigd_enq2(vcc, as_modify, NULL, NULL, &vcc->local, qos, 0);
443 443 while (test_bit(ATM_VF_WAITING, &vcc->flags) &&
444 444 !test_bit(ATM_VF_RELEASED, &vcc->flags) && sigd) {
445 445 schedule();
446   - prepare_to_wait(sk->sk_sleep, &wait, TASK_UNINTERRUPTIBLE);
  446 + prepare_to_wait(sk_sleep(sk), &wait, TASK_UNINTERRUPTIBLE);
447 447 }
448   - finish_wait(sk->sk_sleep, &wait);
  448 + finish_wait(sk_sleep(sk), &wait);
449 449 if (!sigd)
450 450 return -EUNATCH;
451 451 return -sk->sk_err;
452 452  
453 453  
454 454  
... ... @@ -534,20 +534,20 @@
534 534  
535 535 lock_sock(sk);
536 536 set_bit(ATM_VF_WAITING, &vcc->flags);
537   - prepare_to_wait(sk->sk_sleep, &wait, TASK_INTERRUPTIBLE);
  537 + prepare_to_wait(sk_sleep(sk), &wait, TASK_INTERRUPTIBLE);
538 538 sigd_enq(vcc, as_addparty, NULL, NULL,
539 539 (struct sockaddr_atmsvc *) sockaddr);
540 540 if (flags & O_NONBLOCK) {
541   - finish_wait(sk->sk_sleep, &wait);
  541 + finish_wait(sk_sleep(sk), &wait);
542 542 error = -EINPROGRESS;
543 543 goto out;
544 544 }
545 545 pr_debug("added wait queue\n");
546 546 while (test_bit(ATM_VF_WAITING, &vcc->flags) && sigd) {
547 547 schedule();
548   - prepare_to_wait(sk->sk_sleep, &wait, TASK_INTERRUPTIBLE);
  548 + prepare_to_wait(sk_sleep(sk), &wait, TASK_INTERRUPTIBLE);
549 549 }
550   - finish_wait(sk->sk_sleep, &wait);
  550 + finish_wait(sk_sleep(sk), &wait);
551 551 error = xchg(&sk->sk_err_soft, 0);
552 552 out:
553 553 release_sock(sk);
554 554  
555 555  
... ... @@ -563,13 +563,13 @@
563 563  
564 564 lock_sock(sk);
565 565 set_bit(ATM_VF_WAITING, &vcc->flags);
566   - prepare_to_wait(sk->sk_sleep, &wait, TASK_INTERRUPTIBLE);
  566 + prepare_to_wait(sk_sleep(sk), &wait, TASK_INTERRUPTIBLE);
567 567 sigd_enq2(vcc, as_dropparty, NULL, NULL, NULL, NULL, ep_ref);
568 568 while (test_bit(ATM_VF_WAITING, &vcc->flags) && sigd) {
569 569 schedule();
570   - prepare_to_wait(sk->sk_sleep, &wait, TASK_INTERRUPTIBLE);
  570 + prepare_to_wait(sk_sleep(sk), &wait, TASK_INTERRUPTIBLE);
571 571 }
572   - finish_wait(sk->sk_sleep, &wait);
  572 + finish_wait(sk_sleep(sk), &wait);
573 573 if (!sigd) {
574 574 error = -EUNATCH;
575 575 goto out;
... ... @@ -1281,7 +1281,7 @@
1281 1281 DEFINE_WAIT(wait);
1282 1282  
1283 1283 for (;;) {
1284   - prepare_to_wait(sk->sk_sleep, &wait,
  1284 + prepare_to_wait(sk_sleep(sk), &wait,
1285 1285 TASK_INTERRUPTIBLE);
1286 1286 if (sk->sk_state != TCP_SYN_SENT)
1287 1287 break;
... ... @@ -1294,7 +1294,7 @@
1294 1294 err = -ERESTARTSYS;
1295 1295 break;
1296 1296 }
1297   - finish_wait(sk->sk_sleep, &wait);
  1297 + finish_wait(sk_sleep(sk), &wait);
1298 1298  
1299 1299 if (err)
1300 1300 goto out_release;
... ... @@ -1346,7 +1346,7 @@
1346 1346 * hooked into the SABM we saved
1347 1347 */
1348 1348 for (;;) {
1349   - prepare_to_wait(sk->sk_sleep, &wait, TASK_INTERRUPTIBLE);
  1349 + prepare_to_wait(sk_sleep(sk), &wait, TASK_INTERRUPTIBLE);
1350 1350 skb = skb_dequeue(&sk->sk_receive_queue);
1351 1351 if (skb)
1352 1352 break;
... ... @@ -1364,7 +1364,7 @@
1364 1364 err = -ERESTARTSYS;
1365 1365 break;
1366 1366 }
1367   - finish_wait(sk->sk_sleep, &wait);
  1367 + finish_wait(sk_sleep(sk), &wait);
1368 1368  
1369 1369 if (err)
1370 1370 goto out;
net/bluetooth/af_bluetooth.c
... ... @@ -288,7 +288,7 @@
288 288  
289 289 BT_DBG("sock %p, sk %p", sock, sk);
290 290  
291   - poll_wait(file, sk->sk_sleep, wait);
  291 + poll_wait(file, sk_sleep(sk), wait);
292 292  
293 293 if (sk->sk_state == BT_LISTEN)
294 294 return bt_accept_poll(sk);
... ... @@ -378,7 +378,7 @@
378 378  
379 379 BT_DBG("sk %p", sk);
380 380  
381   - add_wait_queue(sk->sk_sleep, &wait);
  381 + add_wait_queue(sk_sleep(sk), &wait);
382 382 while (sk->sk_state != state) {
383 383 set_current_state(TASK_INTERRUPTIBLE);
384 384  
... ... @@ -401,7 +401,7 @@
401 401 break;
402 402 }
403 403 set_current_state(TASK_RUNNING);
404   - remove_wait_queue(sk->sk_sleep, &wait);
  404 + remove_wait_queue(sk_sleep(sk), &wait);
405 405 return err;
406 406 }
407 407 EXPORT_SYMBOL(bt_sock_wait_state);
net/bluetooth/bnep/core.c
... ... @@ -474,7 +474,7 @@
474 474 set_user_nice(current, -15);
475 475  
476 476 init_waitqueue_entry(&wait, current);
477   - add_wait_queue(sk->sk_sleep, &wait);
  477 + add_wait_queue(sk_sleep(sk), &wait);
478 478 while (!atomic_read(&s->killed)) {
479 479 set_current_state(TASK_INTERRUPTIBLE);
480 480  
... ... @@ -496,7 +496,7 @@
496 496 schedule();
497 497 }
498 498 set_current_state(TASK_RUNNING);
499   - remove_wait_queue(sk->sk_sleep, &wait);
  499 + remove_wait_queue(sk_sleep(sk), &wait);
500 500  
501 501 /* Cleanup session */
502 502 down_write(&bnep_session_sem);
... ... @@ -507,7 +507,7 @@
507 507 /* Wakeup user-space polling for socket errors */
508 508 s->sock->sk->sk_err = EUNATCH;
509 509  
510   - wake_up_interruptible(s->sock->sk->sk_sleep);
  510 + wake_up_interruptible(sk_sleep(s->sock->sk));
511 511  
512 512 /* Release the socket */
513 513 fput(s->sock->file);
... ... @@ -638,7 +638,7 @@
638 638  
639 639 /* Kill session thread */
640 640 atomic_inc(&s->killed);
641   - wake_up_interruptible(s->sock->sk->sk_sleep);
  641 + wake_up_interruptible(sk_sleep(s->sock->sk));
642 642 } else
643 643 err = -ENOENT;
644 644  
net/bluetooth/bnep/netdev.c
... ... @@ -109,7 +109,7 @@
109 109 }
110 110  
111 111 skb_queue_tail(&sk->sk_write_queue, skb);
112   - wake_up_interruptible(sk->sk_sleep);
  112 + wake_up_interruptible(sk_sleep(sk));
113 113 #endif
114 114 }
115 115  
116 116  
... ... @@ -193,11 +193,11 @@
193 193 /*
194 194 * We cannot send L2CAP packets from here as we are potentially in a bh.
195 195 * So we have to queue them and wake up session thread which is sleeping
196   - * on the sk->sk_sleep.
  196 + * on the sk_sleep(sk).
197 197 */
198 198 dev->trans_start = jiffies;
199 199 skb_queue_tail(&sk->sk_write_queue, skb);
200   - wake_up_interruptible(sk->sk_sleep);
  200 + wake_up_interruptible(sk_sleep(sk));
201 201  
202 202 if (skb_queue_len(&sk->sk_write_queue) >= BNEP_TX_QUEUE_LEN) {
203 203 BT_DBG("tx queue is full");
net/bluetooth/cmtp/cmtp.h
... ... @@ -125,7 +125,7 @@
125 125 {
126 126 struct sock *sk = session->sock->sk;
127 127  
128   - wake_up_interruptible(sk->sk_sleep);
  128 + wake_up_interruptible(sk_sleep(sk));
129 129 }
130 130  
131 131 /* CMTP init defines */
net/bluetooth/cmtp/core.c
... ... @@ -284,7 +284,7 @@
284 284 set_user_nice(current, -15);
285 285  
286 286 init_waitqueue_entry(&wait, current);
287   - add_wait_queue(sk->sk_sleep, &wait);
  287 + add_wait_queue(sk_sleep(sk), &wait);
288 288 while (!atomic_read(&session->terminate)) {
289 289 set_current_state(TASK_INTERRUPTIBLE);
290 290  
... ... @@ -301,7 +301,7 @@
301 301 schedule();
302 302 }
303 303 set_current_state(TASK_RUNNING);
304   - remove_wait_queue(sk->sk_sleep, &wait);
  304 + remove_wait_queue(sk_sleep(sk), &wait);
305 305  
306 306 down_write(&cmtp_session_sem);
307 307  
net/bluetooth/hidp/core.c
... ... @@ -561,8 +561,8 @@
561 561  
562 562 init_waitqueue_entry(&ctrl_wait, current);
563 563 init_waitqueue_entry(&intr_wait, current);
564   - add_wait_queue(ctrl_sk->sk_sleep, &ctrl_wait);
565   - add_wait_queue(intr_sk->sk_sleep, &intr_wait);
  564 + add_wait_queue(sk_sleep(ctrl_sk), &ctrl_wait);
  565 + add_wait_queue(sk_sleep(intr_sk), &intr_wait);
566 566 while (!atomic_read(&session->terminate)) {
567 567 set_current_state(TASK_INTERRUPTIBLE);
568 568  
... ... @@ -584,8 +584,8 @@
584 584 schedule();
585 585 }
586 586 set_current_state(TASK_RUNNING);
587   - remove_wait_queue(intr_sk->sk_sleep, &intr_wait);
588   - remove_wait_queue(ctrl_sk->sk_sleep, &ctrl_wait);
  587 + remove_wait_queue(sk_sleep(intr_sk), &intr_wait);
  588 + remove_wait_queue(sk_sleep(ctrl_sk), &ctrl_wait);
589 589  
590 590 down_write(&hidp_session_sem);
591 591  
... ... @@ -609,7 +609,7 @@
609 609  
610 610 fput(session->intr_sock->file);
611 611  
612   - wait_event_timeout(*(ctrl_sk->sk_sleep),
  612 + wait_event_timeout(*(sk_sleep(ctrl_sk)),
613 613 (ctrl_sk->sk_state == BT_CLOSED), msecs_to_jiffies(500));
614 614  
615 615 fput(session->ctrl_sock->file);
net/bluetooth/hidp/hidp.h
... ... @@ -164,8 +164,8 @@
164 164 struct sock *ctrl_sk = session->ctrl_sock->sk;
165 165 struct sock *intr_sk = session->intr_sock->sk;
166 166  
167   - wake_up_interruptible(ctrl_sk->sk_sleep);
168   - wake_up_interruptible(intr_sk->sk_sleep);
  167 + wake_up_interruptible(sk_sleep(ctrl_sk));
  168 + wake_up_interruptible(sk_sleep(intr_sk));
169 169 }
170 170  
171 171 /* HIDP init defines */
net/bluetooth/l2cap.c
... ... @@ -1147,7 +1147,7 @@
1147 1147 BT_DBG("sk %p timeo %ld", sk, timeo);
1148 1148  
1149 1149 /* Wait for an incoming connection. (wake-one). */
1150   - add_wait_queue_exclusive(sk->sk_sleep, &wait);
  1150 + add_wait_queue_exclusive(sk_sleep(sk), &wait);
1151 1151 while (!(nsk = bt_accept_dequeue(sk, newsock))) {
1152 1152 set_current_state(TASK_INTERRUPTIBLE);
1153 1153 if (!timeo) {
... ... @@ -1170,7 +1170,7 @@
1170 1170 }
1171 1171 }
1172 1172 set_current_state(TASK_RUNNING);
1173   - remove_wait_queue(sk->sk_sleep, &wait);
  1173 + remove_wait_queue(sk_sleep(sk), &wait);
1174 1174  
1175 1175 if (err)
1176 1176 goto done;
net/bluetooth/rfcomm/sock.c
... ... @@ -503,7 +503,7 @@
503 503 BT_DBG("sk %p timeo %ld", sk, timeo);
504 504  
505 505 /* Wait for an incoming connection. (wake-one). */
506   - add_wait_queue_exclusive(sk->sk_sleep, &wait);
  506 + add_wait_queue_exclusive(sk_sleep(sk), &wait);
507 507 while (!(nsk = bt_accept_dequeue(sk, newsock))) {
508 508 set_current_state(TASK_INTERRUPTIBLE);
509 509 if (!timeo) {
... ... @@ -526,7 +526,7 @@
526 526 }
527 527 }
528 528 set_current_state(TASK_RUNNING);
529   - remove_wait_queue(sk->sk_sleep, &wait);
  529 + remove_wait_queue(sk_sleep(sk), &wait);
530 530  
531 531 if (err)
532 532 goto done;
... ... @@ -621,7 +621,7 @@
621 621 {
622 622 DECLARE_WAITQUEUE(wait, current);
623 623  
624   - add_wait_queue(sk->sk_sleep, &wait);
  624 + add_wait_queue(sk_sleep(sk), &wait);
625 625 for (;;) {
626 626 set_current_state(TASK_INTERRUPTIBLE);
627 627  
... ... @@ -640,7 +640,7 @@
640 640 }
641 641  
642 642 __set_current_state(TASK_RUNNING);
643   - remove_wait_queue(sk->sk_sleep, &wait);
  643 + remove_wait_queue(sk_sleep(sk), &wait);
644 644 return timeo;
645 645 }
646 646  
... ... @@ -567,7 +567,7 @@
567 567 BT_DBG("sk %p timeo %ld", sk, timeo);
568 568  
569 569 /* Wait for an incoming connection. (wake-one). */
570   - add_wait_queue_exclusive(sk->sk_sleep, &wait);
  570 + add_wait_queue_exclusive(sk_sleep(sk), &wait);
571 571 while (!(ch = bt_accept_dequeue(sk, newsock))) {
572 572 set_current_state(TASK_INTERRUPTIBLE);
573 573 if (!timeo) {
... ... @@ -590,7 +590,7 @@
590 590 }
591 591 }
592 592 set_current_state(TASK_RUNNING);
593   - remove_wait_queue(sk->sk_sleep, &wait);
  593 + remove_wait_queue(sk_sleep(sk), &wait);
594 594  
595 595 if (err)
596 596 goto done;
net/caif/caif_socket.c
... ... @@ -689,7 +689,7 @@
689 689 struct sock *sk = sock->sk;
690 690 struct caifsock *cf_sk = container_of(sk, struct caifsock, sk);
691 691 u32 mask = 0;
692   - poll_wait(file, sk->sk_sleep, wait);
  692 + poll_wait(file, sk_sleep(sk), wait);
693 693 lock_sock(&(cf_sk->sk));
694 694 if (!STATE_IS_OPEN(cf_sk)) {
695 695 if (!STATE_IS_PENDING(cf_sk))
... ... @@ -86,7 +86,7 @@
86 86 int error;
87 87 DEFINE_WAIT_FUNC(wait, receiver_wake_function);
88 88  
89   - prepare_to_wait_exclusive(sk->sk_sleep, &wait, TASK_INTERRUPTIBLE);
  89 + prepare_to_wait_exclusive(sk_sleep(sk), &wait, TASK_INTERRUPTIBLE);
90 90  
91 91 /* Socket errors? */
92 92 error = sock_error(sk);
... ... @@ -115,7 +115,7 @@
115 115 error = 0;
116 116 *timeo_p = schedule_timeout(*timeo_p);
117 117 out:
118   - finish_wait(sk->sk_sleep, &wait);
  118 + finish_wait(sk_sleep(sk), &wait);
119 119 return error;
120 120 interrupted:
121 121 error = sock_intr_errno(*timeo_p);
... ... @@ -726,7 +726,7 @@
726 726 struct sock *sk = sock->sk;
727 727 unsigned int mask;
728 728  
729   - sock_poll_wait(file, sk->sk_sleep, wait);
  729 + sock_poll_wait(file, sk_sleep(sk), wait);
730 730 mask = 0;
731 731  
732 732 /* exceptional events? */
... ... @@ -1395,7 +1395,7 @@
1395 1395 if (signal_pending(current))
1396 1396 break;
1397 1397 set_bit(SOCK_NOSPACE, &sk->sk_socket->flags);
1398   - prepare_to_wait(sk->sk_sleep, &wait, TASK_INTERRUPTIBLE);
  1398 + prepare_to_wait(sk_sleep(sk), &wait, TASK_INTERRUPTIBLE);
1399 1399 if (atomic_read(&sk->sk_wmem_alloc) < sk->sk_sndbuf)
1400 1400 break;
1401 1401 if (sk->sk_shutdown & SEND_SHUTDOWN)
... ... @@ -1404,7 +1404,7 @@
1404 1404 break;
1405 1405 timeo = schedule_timeout(timeo);
1406 1406 }
1407   - finish_wait(sk->sk_sleep, &wait);
  1407 + finish_wait(sk_sleep(sk), &wait);
1408 1408 return timeo;
1409 1409 }
1410 1410  
1411 1411  
... ... @@ -1570,11 +1570,11 @@
1570 1570 int rc;
1571 1571 DEFINE_WAIT(wait);
1572 1572  
1573   - prepare_to_wait(sk->sk_sleep, &wait, TASK_INTERRUPTIBLE);
  1573 + prepare_to_wait(sk_sleep(sk), &wait, TASK_INTERRUPTIBLE);
1574 1574 set_bit(SOCK_ASYNC_WAITDATA, &sk->sk_socket->flags);
1575 1575 rc = sk_wait_event(sk, timeo, !skb_queue_empty(&sk->sk_receive_queue));
1576 1576 clear_bit(SOCK_ASYNC_WAITDATA, &sk->sk_socket->flags);
1577   - finish_wait(sk->sk_sleep, &wait);
  1577 + finish_wait(sk_sleep(sk), &wait);
1578 1578 return rc;
1579 1579 }
1580 1580 EXPORT_SYMBOL(sk_wait_data);
... ... @@ -1798,7 +1798,7 @@
1798 1798 {
1799 1799 read_lock(&sk->sk_callback_lock);
1800 1800 if (sk_has_sleeper(sk))
1801   - wake_up_interruptible_all(sk->sk_sleep);
  1801 + wake_up_interruptible_all(sk_sleep(sk));
1802 1802 read_unlock(&sk->sk_callback_lock);
1803 1803 }
1804 1804  
... ... @@ -1806,7 +1806,7 @@
1806 1806 {
1807 1807 read_lock(&sk->sk_callback_lock);
1808 1808 if (sk_has_sleeper(sk))
1809   - wake_up_interruptible_poll(sk->sk_sleep, POLLERR);
  1809 + wake_up_interruptible_poll(sk_sleep(sk), POLLERR);
1810 1810 sk_wake_async(sk, SOCK_WAKE_IO, POLL_ERR);
1811 1811 read_unlock(&sk->sk_callback_lock);
1812 1812 }
... ... @@ -1815,7 +1815,7 @@
1815 1815 {
1816 1816 read_lock(&sk->sk_callback_lock);
1817 1817 if (sk_has_sleeper(sk))
1818   - wake_up_interruptible_sync_poll(sk->sk_sleep, POLLIN |
  1818 + wake_up_interruptible_sync_poll(sk_sleep(sk), POLLIN |
1819 1819 POLLRDNORM | POLLRDBAND);
1820 1820 sk_wake_async(sk, SOCK_WAKE_WAITD, POLL_IN);
1821 1821 read_unlock(&sk->sk_callback_lock);
... ... @@ -1830,7 +1830,7 @@
1830 1830 */
1831 1831 if ((atomic_read(&sk->sk_wmem_alloc) << 1) <= sk->sk_sndbuf) {
1832 1832 if (sk_has_sleeper(sk))
1833   - wake_up_interruptible_sync_poll(sk->sk_sleep, POLLOUT |
  1833 + wake_up_interruptible_sync_poll(sk_sleep(sk), POLLOUT |
1834 1834 POLLWRNORM | POLLWRBAND);
1835 1835  
1836 1836 /* Should agree with poll, otherwise some programs break */
... ... @@ -32,8 +32,8 @@
32 32 if (sk_stream_wspace(sk) >= sk_stream_min_wspace(sk) && sock) {
33 33 clear_bit(SOCK_NOSPACE, &sock->flags);
34 34  
35   - if (sk->sk_sleep && waitqueue_active(sk->sk_sleep))
36   - wake_up_interruptible_poll(sk->sk_sleep, POLLOUT |
  35 + if (sk_sleep(sk) && waitqueue_active(sk_sleep(sk)))
  36 + wake_up_interruptible_poll(sk_sleep(sk), POLLOUT |
37 37 POLLWRNORM | POLLWRBAND);
38 38 if (sock->fasync_list && !(sk->sk_shutdown & SEND_SHUTDOWN))
39 39 sock_wake_async(sock, SOCK_WAKE_SPACE, POLL_OUT);
40 40  
... ... @@ -66,13 +66,13 @@
66 66 if (signal_pending(tsk))
67 67 return sock_intr_errno(*timeo_p);
68 68  
69   - prepare_to_wait(sk->sk_sleep, &wait, TASK_INTERRUPTIBLE);
  69 + prepare_to_wait(sk_sleep(sk), &wait, TASK_INTERRUPTIBLE);
70 70 sk->sk_write_pending++;
71 71 done = sk_wait_event(sk, timeo_p,
72 72 !sk->sk_err &&
73 73 !((1 << sk->sk_state) &
74 74 ~(TCPF_ESTABLISHED | TCPF_CLOSE_WAIT)));
75   - finish_wait(sk->sk_sleep, &wait);
  75 + finish_wait(sk_sleep(sk), &wait);
76 76 sk->sk_write_pending--;
77 77 } while (!done);
78 78 return 0;
79 79  
... ... @@ -96,13 +96,13 @@
96 96 DEFINE_WAIT(wait);
97 97  
98 98 do {
99   - prepare_to_wait(sk->sk_sleep, &wait,
  99 + prepare_to_wait(sk_sleep(sk), &wait,
100 100 TASK_INTERRUPTIBLE);
101 101 if (sk_wait_event(sk, &timeout, !sk_stream_closing(sk)))
102 102 break;
103 103 } while (!signal_pending(current) && timeout);
104 104  
105   - finish_wait(sk->sk_sleep, &wait);
  105 + finish_wait(sk_sleep(sk), &wait);
106 106 }
107 107 }
108 108  
... ... @@ -126,7 +126,7 @@
126 126 while (1) {
127 127 set_bit(SOCK_ASYNC_NOSPACE, &sk->sk_socket->flags);
128 128  
129   - prepare_to_wait(sk->sk_sleep, &wait, TASK_INTERRUPTIBLE);
  129 + prepare_to_wait(sk_sleep(sk), &wait, TASK_INTERRUPTIBLE);
130 130  
131 131 if (sk->sk_err || (sk->sk_shutdown & SEND_SHUTDOWN))
132 132 goto do_error;
... ... @@ -157,7 +157,7 @@
157 157 *timeo_p = current_timeo;
158 158 }
159 159 out:
160   - finish_wait(sk->sk_sleep, &wait);
  160 + finish_wait(sk_sleep(sk), &wait);
161 161 return err;
162 162  
163 163 do_error:
... ... @@ -198,7 +198,7 @@
198 198 read_lock(&sk->sk_callback_lock);
199 199  
200 200 if (sk_has_sleeper(sk))
201   - wake_up_interruptible(sk->sk_sleep);
  201 + wake_up_interruptible(sk_sleep(sk));
202 202 /* Should agree with poll, otherwise some programs break */
203 203 if (sock_writeable(sk))
204 204 sk_wake_async(sk, SOCK_WAKE_SPACE, POLL_OUT);
... ... @@ -225,7 +225,7 @@
225 225 dccp_pr_debug("delayed send by %d msec\n", delay);
226 226 jiffdelay = msecs_to_jiffies(delay);
227 227  
228   - prepare_to_wait(sk->sk_sleep, &wait, TASK_INTERRUPTIBLE);
  228 + prepare_to_wait(sk_sleep(sk), &wait, TASK_INTERRUPTIBLE);
229 229  
230 230 sk->sk_write_pending++;
231 231 release_sock(sk);
... ... @@ -241,7 +241,7 @@
241 241 rc = ccid_hc_tx_send_packet(dp->dccps_hc_tx_ccid, sk, skb);
242 242 } while ((delay = rc) > 0);
243 243 out:
244   - finish_wait(sk->sk_sleep, &wait);
  244 + finish_wait(sk_sleep(sk), &wait);
245 245 return rc;
246 246  
247 247 do_error:
... ... @@ -312,7 +312,7 @@
312 312 unsigned int mask;
313 313 struct sock *sk = sock->sk;
314 314  
315   - sock_poll_wait(file, sk->sk_sleep, wait);
  315 + sock_poll_wait(file, sk_sleep(sk), wait);
316 316 if (sk->sk_state == DCCP_LISTEN)
317 317 return inet_csk_listen_poll(sk);
318 318  
net/decnet/af_decnet.c
... ... @@ -832,7 +832,7 @@
832 832 scp->segsize_loc = dst_metric(__sk_dst_get(sk), RTAX_ADVMSS);
833 833 dn_send_conn_conf(sk, allocation);
834 834  
835   - prepare_to_wait(sk->sk_sleep, &wait, TASK_INTERRUPTIBLE);
  835 + prepare_to_wait(sk_sleep(sk), &wait, TASK_INTERRUPTIBLE);
836 836 for(;;) {
837 837 release_sock(sk);
838 838 if (scp->state == DN_CC)
839 839  
... ... @@ -850,9 +850,9 @@
850 850 err = -EAGAIN;
851 851 if (!*timeo)
852 852 break;
853   - prepare_to_wait(sk->sk_sleep, &wait, TASK_INTERRUPTIBLE);
  853 + prepare_to_wait(sk_sleep(sk), &wait, TASK_INTERRUPTIBLE);
854 854 }
855   - finish_wait(sk->sk_sleep, &wait);
  855 + finish_wait(sk_sleep(sk), &wait);
856 856 if (err == 0) {
857 857 sk->sk_socket->state = SS_CONNECTED;
858 858 } else if (scp->state != DN_CC) {
... ... @@ -873,7 +873,7 @@
873 873 if (!*timeo)
874 874 return -EALREADY;
875 875  
876   - prepare_to_wait(sk->sk_sleep, &wait, TASK_INTERRUPTIBLE);
  876 + prepare_to_wait(sk_sleep(sk), &wait, TASK_INTERRUPTIBLE);
877 877 for(;;) {
878 878 release_sock(sk);
879 879 if (scp->state == DN_CI || scp->state == DN_CC)
880 880  
... ... @@ -891,9 +891,9 @@
891 891 err = -ETIMEDOUT;
892 892 if (!*timeo)
893 893 break;
894   - prepare_to_wait(sk->sk_sleep, &wait, TASK_INTERRUPTIBLE);
  894 + prepare_to_wait(sk_sleep(sk), &wait, TASK_INTERRUPTIBLE);
895 895 }
896   - finish_wait(sk->sk_sleep, &wait);
  896 + finish_wait(sk_sleep(sk), &wait);
897 897 out:
898 898 if (err == 0) {
899 899 sk->sk_socket->state = SS_CONNECTED;
... ... @@ -1040,7 +1040,7 @@
1040 1040 struct sk_buff *skb = NULL;
1041 1041 int err = 0;
1042 1042  
1043   - prepare_to_wait(sk->sk_sleep, &wait, TASK_INTERRUPTIBLE);
  1043 + prepare_to_wait(sk_sleep(sk), &wait, TASK_INTERRUPTIBLE);
1044 1044 for(;;) {
1045 1045 release_sock(sk);
1046 1046 skb = skb_dequeue(&sk->sk_receive_queue);
1047 1047  
... ... @@ -1060,9 +1060,9 @@
1060 1060 err = -EAGAIN;
1061 1061 if (!*timeo)
1062 1062 break;
1063   - prepare_to_wait(sk->sk_sleep, &wait, TASK_INTERRUPTIBLE);
  1063 + prepare_to_wait(sk_sleep(sk), &wait, TASK_INTERRUPTIBLE);
1064 1064 }
1065   - finish_wait(sk->sk_sleep, &wait);
  1065 + finish_wait(sk_sleep(sk), &wait);
1066 1066  
1067 1067 return skb == NULL ? ERR_PTR(err) : skb;
1068 1068 }
1069 1069  
... ... @@ -1746,11 +1746,11 @@
1746 1746 goto out;
1747 1747 }
1748 1748  
1749   - prepare_to_wait(sk->sk_sleep, &wait, TASK_INTERRUPTIBLE);
  1749 + prepare_to_wait(sk_sleep(sk), &wait, TASK_INTERRUPTIBLE);
1750 1750 set_bit(SOCK_ASYNC_WAITDATA, &sk->sk_socket->flags);
1751 1751 sk_wait_event(sk, &timeo, dn_data_ready(sk, queue, flags, target));
1752 1752 clear_bit(SOCK_ASYNC_WAITDATA, &sk->sk_socket->flags);
1753   - finish_wait(sk->sk_sleep, &wait);
  1753 + finish_wait(sk_sleep(sk), &wait);
1754 1754 }
1755 1755  
1756 1756 skb_queue_walk_safe(queue, skb, n) {
1757 1757  
... ... @@ -2003,12 +2003,12 @@
2003 2003 goto out;
2004 2004 }
2005 2005  
2006   - prepare_to_wait(sk->sk_sleep, &wait, TASK_INTERRUPTIBLE);
  2006 + prepare_to_wait(sk_sleep(sk), &wait, TASK_INTERRUPTIBLE);
2007 2007 set_bit(SOCK_ASYNC_WAITDATA, &sk->sk_socket->flags);
2008 2008 sk_wait_event(sk, &timeo,
2009 2009 !dn_queue_too_long(scp, queue, flags));
2010 2010 clear_bit(SOCK_ASYNC_WAITDATA, &sk->sk_socket->flags);
2011   - finish_wait(sk->sk_sleep, &wait);
  2011 + finish_wait(sk_sleep(sk), &wait);
2012 2012 continue;
2013 2013 }
2014 2014  
... ... @@ -548,7 +548,7 @@
548 548 {
549 549 DEFINE_WAIT(wait);
550 550  
551   - prepare_to_wait(sk->sk_sleep, &wait, TASK_INTERRUPTIBLE);
  551 + prepare_to_wait(sk_sleep(sk), &wait, TASK_INTERRUPTIBLE);
552 552  
553 553 /* Basic assumption: if someone sets sk->sk_err, he _must_
554 554 * change state of the socket from TCP_SYN_*.
555 555  
... ... @@ -561,9 +561,9 @@
561 561 lock_sock(sk);
562 562 if (signal_pending(current) || !timeo)
563 563 break;
564   - prepare_to_wait(sk->sk_sleep, &wait, TASK_INTERRUPTIBLE);
  564 + prepare_to_wait(sk_sleep(sk), &wait, TASK_INTERRUPTIBLE);
565 565 }
566   - finish_wait(sk->sk_sleep, &wait);
  566 + finish_wait(sk_sleep(sk), &wait);
567 567 return timeo;
568 568 }
569 569  
net/ipv4/inet_connection_sock.c
... ... @@ -234,7 +234,7 @@
234 234 * having to remove and re-insert us on the wait queue.
235 235 */
236 236 for (;;) {
237   - prepare_to_wait_exclusive(sk->sk_sleep, &wait,
  237 + prepare_to_wait_exclusive(sk_sleep(sk), &wait,
238 238 TASK_INTERRUPTIBLE);
239 239 release_sock(sk);
240 240 if (reqsk_queue_empty(&icsk->icsk_accept_queue))
... ... @@ -253,7 +253,7 @@
253 253 if (!timeo)
254 254 break;
255 255 }
256   - finish_wait(sk->sk_sleep, &wait);
  256 + finish_wait(sk_sleep(sk), &wait);
257 257 return err;
258 258 }
259 259  
... ... @@ -378,7 +378,7 @@
378 378 struct sock *sk = sock->sk;
379 379 struct tcp_sock *tp = tcp_sk(sk);
380 380  
381   - sock_poll_wait(file, sk->sk_sleep, wait);
  381 + sock_poll_wait(file, sk_sleep(sk), wait);
382 382 if (sk->sk_state == TCP_LISTEN)
383 383 return inet_csk_listen_poll(sk);
384 384  
... ... @@ -347,7 +347,7 @@
347 347 self->tx_flow = flow;
348 348 IRDA_DEBUG(1, "%s(), IrTTP wants us to start again\n",
349 349 __func__);
350   - wake_up_interruptible(sk->sk_sleep);
  350 + wake_up_interruptible(sk_sleep(sk));
351 351 break;
352 352 default:
353 353 IRDA_DEBUG(0, "%s(), Unknown flow command!\n", __func__);
... ... @@ -900,7 +900,7 @@
900 900 if (flags & O_NONBLOCK)
901 901 goto out;
902 902  
903   - err = wait_event_interruptible(*(sk->sk_sleep),
  903 + err = wait_event_interruptible(*(sk_sleep(sk)),
904 904 skb_peek(&sk->sk_receive_queue));
905 905 if (err)
906 906 goto out;
... ... @@ -1066,7 +1066,7 @@
1066 1066 goto out;
1067 1067  
1068 1068 err = -ERESTARTSYS;
1069   - if (wait_event_interruptible(*(sk->sk_sleep),
  1069 + if (wait_event_interruptible(*(sk_sleep(sk)),
1070 1070 (sk->sk_state != TCP_SYN_SENT)))
1071 1071 goto out;
1072 1072  
... ... @@ -1318,7 +1318,7 @@
1318 1318  
1319 1319 /* Check if IrTTP is wants us to slow down */
1320 1320  
1321   - if (wait_event_interruptible(*(sk->sk_sleep),
  1321 + if (wait_event_interruptible(*(sk_sleep(sk)),
1322 1322 (self->tx_flow != FLOW_STOP || sk->sk_state != TCP_ESTABLISHED))) {
1323 1323 err = -ERESTARTSYS;
1324 1324 goto out;
... ... @@ -1477,7 +1477,7 @@
1477 1477 if (copied >= target)
1478 1478 break;
1479 1479  
1480   - prepare_to_wait_exclusive(sk->sk_sleep, &wait, TASK_INTERRUPTIBLE);
  1480 + prepare_to_wait_exclusive(sk_sleep(sk), &wait, TASK_INTERRUPTIBLE);
1481 1481  
1482 1482 /*
1483 1483 * POSIX 1003.1g mandates this order.
... ... @@ -1497,7 +1497,7 @@
1497 1497 /* Wait process until data arrives */
1498 1498 schedule();
1499 1499  
1500   - finish_wait(sk->sk_sleep, &wait);
  1500 + finish_wait(sk_sleep(sk), &wait);
1501 1501  
1502 1502 if (err)
1503 1503 goto out;
... ... @@ -1787,7 +1787,7 @@
1787 1787 IRDA_DEBUG(4, "%s()\n", __func__);
1788 1788  
1789 1789 lock_kernel();
1790   - poll_wait(file, sk->sk_sleep, wait);
  1790 + poll_wait(file, sk_sleep(sk), wait);
1791 1791 mask = 0;
1792 1792  
1793 1793 /* Exceptional events? */
... ... @@ -59,7 +59,7 @@
59 59 DEFINE_WAIT(__wait); \
60 60 long __timeo = timeo; \
61 61 ret = 0; \
62   - prepare_to_wait(sk->sk_sleep, &__wait, TASK_INTERRUPTIBLE); \
  62 + prepare_to_wait(sk_sleep(sk), &__wait, TASK_INTERRUPTIBLE); \
63 63 while (!(condition)) { \
64 64 if (!__timeo) { \
65 65 ret = -EAGAIN; \
... ... @@ -76,7 +76,7 @@
76 76 if (ret) \
77 77 break; \
78 78 } \
79   - finish_wait(sk->sk_sleep, &__wait); \
  79 + finish_wait(sk_sleep(sk), &__wait); \
80 80 } while (0)
81 81  
82 82 #define iucv_sock_wait(sk, condition, timeo) \
... ... @@ -307,7 +307,7 @@
307 307 {
308 308 read_lock(&sk->sk_callback_lock);
309 309 if (sk_has_sleeper(sk))
310   - wake_up_interruptible_all(sk->sk_sleep);
  310 + wake_up_interruptible_all(sk_sleep(sk));
311 311 sk_wake_async(sk, SOCK_WAKE_SPACE, POLL_OUT);
312 312 read_unlock(&sk->sk_callback_lock);
313 313 }
... ... @@ -795,7 +795,7 @@
795 795 timeo = sock_rcvtimeo(sk, flags & O_NONBLOCK);
796 796  
797 797 /* Wait for an incoming connection */
798   - add_wait_queue_exclusive(sk->sk_sleep, &wait);
  798 + add_wait_queue_exclusive(sk_sleep(sk), &wait);
799 799 while (!(nsk = iucv_accept_dequeue(sk, newsock))) {
800 800 set_current_state(TASK_INTERRUPTIBLE);
801 801 if (!timeo) {
... ... @@ -819,7 +819,7 @@
819 819 }
820 820  
821 821 set_current_state(TASK_RUNNING);
822   - remove_wait_queue(sk->sk_sleep, &wait);
  822 + remove_wait_queue(sk_sleep(sk), &wait);
823 823  
824 824 if (err)
825 825 goto done;
... ... @@ -1269,7 +1269,7 @@
1269 1269 struct sock *sk = sock->sk;
1270 1270 unsigned int mask = 0;
1271