diff options
author | Eric Dumazet <eric.dumazet@gmail.com> | 2010-04-20 09:03:51 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-04-20 19:37:13 -0400 |
commit | aa395145165cb06a0d0885221bbe0ce4a564391d (patch) | |
tree | 118b0403621f10db8dc3dbf12079f9af5b19e05d /net/irda | |
parent | ab9304717f7624c41927f442e6b6d418b2d8b3e4 (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/irda')
-rw-r--r-- | net/irda/af_irda.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/net/irda/af_irda.c b/net/irda/af_irda.c index 2a4efcea3423..79986a674f6e 100644 --- a/net/irda/af_irda.c +++ b/net/irda/af_irda.c | |||
@@ -347,7 +347,7 @@ static void irda_flow_indication(void *instance, void *sap, LOCAL_FLOW flow) | |||
347 | self->tx_flow = flow; | 347 | self->tx_flow = flow; |
348 | IRDA_DEBUG(1, "%s(), IrTTP wants us to start again\n", | 348 | IRDA_DEBUG(1, "%s(), IrTTP wants us to start again\n", |
349 | __func__); | 349 | __func__); |
350 | wake_up_interruptible(sk->sk_sleep); | 350 | wake_up_interruptible(sk_sleep(sk)); |
351 | break; | 351 | break; |
352 | default: | 352 | default: |
353 | IRDA_DEBUG(0, "%s(), Unknown flow command!\n", __func__); | 353 | IRDA_DEBUG(0, "%s(), Unknown flow command!\n", __func__); |
@@ -900,7 +900,7 @@ static int irda_accept(struct socket *sock, struct socket *newsock, int flags) | |||
900 | if (flags & O_NONBLOCK) | 900 | if (flags & O_NONBLOCK) |
901 | goto out; | 901 | goto out; |
902 | 902 | ||
903 | err = wait_event_interruptible(*(sk->sk_sleep), | 903 | err = wait_event_interruptible(*(sk_sleep(sk)), |
904 | skb_peek(&sk->sk_receive_queue)); | 904 | skb_peek(&sk->sk_receive_queue)); |
905 | if (err) | 905 | if (err) |
906 | goto out; | 906 | goto out; |
@@ -1066,7 +1066,7 @@ static int irda_connect(struct socket *sock, struct sockaddr *uaddr, | |||
1066 | goto out; | 1066 | goto out; |
1067 | 1067 | ||
1068 | err = -ERESTARTSYS; | 1068 | err = -ERESTARTSYS; |
1069 | if (wait_event_interruptible(*(sk->sk_sleep), | 1069 | if (wait_event_interruptible(*(sk_sleep(sk)), |
1070 | (sk->sk_state != TCP_SYN_SENT))) | 1070 | (sk->sk_state != TCP_SYN_SENT))) |
1071 | goto out; | 1071 | goto out; |
1072 | 1072 | ||
@@ -1318,7 +1318,7 @@ static int irda_sendmsg(struct kiocb *iocb, struct socket *sock, | |||
1318 | 1318 | ||
1319 | /* Check if IrTTP is wants us to slow down */ | 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 | (self->tx_flow != FLOW_STOP || sk->sk_state != TCP_ESTABLISHED))) { | 1322 | (self->tx_flow != FLOW_STOP || sk->sk_state != TCP_ESTABLISHED))) { |
1323 | err = -ERESTARTSYS; | 1323 | err = -ERESTARTSYS; |
1324 | goto out; | 1324 | goto out; |
@@ -1477,7 +1477,7 @@ static int irda_recvmsg_stream(struct kiocb *iocb, struct socket *sock, | |||
1477 | if (copied >= target) | 1477 | if (copied >= target) |
1478 | break; | 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 | * POSIX 1003.1g mandates this order. | 1483 | * POSIX 1003.1g mandates this order. |
@@ -1497,7 +1497,7 @@ static int irda_recvmsg_stream(struct kiocb *iocb, struct socket *sock, | |||
1497 | /* Wait process until data arrives */ | 1497 | /* Wait process until data arrives */ |
1498 | schedule(); | 1498 | schedule(); |
1499 | 1499 | ||
1500 | finish_wait(sk->sk_sleep, &wait); | 1500 | finish_wait(sk_sleep(sk), &wait); |
1501 | 1501 | ||
1502 | if (err) | 1502 | if (err) |
1503 | goto out; | 1503 | goto out; |
@@ -1787,7 +1787,7 @@ static unsigned int irda_poll(struct file * file, struct socket *sock, | |||
1787 | IRDA_DEBUG(4, "%s()\n", __func__); | 1787 | IRDA_DEBUG(4, "%s()\n", __func__); |
1788 | 1788 | ||
1789 | lock_kernel(); | 1789 | lock_kernel(); |
1790 | poll_wait(file, sk->sk_sleep, wait); | 1790 | poll_wait(file, sk_sleep(sk), wait); |
1791 | mask = 0; | 1791 | mask = 0; |
1792 | 1792 | ||
1793 | /* Exceptional events? */ | 1793 | /* Exceptional events? */ |