mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-30 19:51:31 -04:00
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 <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
This commit is contained in:
parent
ab9304717f
commit
aa39514516
46 changed files with 208 additions and 204 deletions
|
|
@ -718,7 +718,7 @@ static int x25_wait_for_connection_establishment(struct sock *sk)
|
|||
DECLARE_WAITQUEUE(wait, current);
|
||||
int rc;
|
||||
|
||||
add_wait_queue_exclusive(sk->sk_sleep, &wait);
|
||||
add_wait_queue_exclusive(sk_sleep(sk), &wait);
|
||||
for (;;) {
|
||||
__set_current_state(TASK_INTERRUPTIBLE);
|
||||
rc = -ERESTARTSYS;
|
||||
|
|
@ -738,7 +738,7 @@ static int x25_wait_for_connection_establishment(struct sock *sk)
|
|||
break;
|
||||
}
|
||||
__set_current_state(TASK_RUNNING);
|
||||
remove_wait_queue(sk->sk_sleep, &wait);
|
||||
remove_wait_queue(sk_sleep(sk), &wait);
|
||||
return rc;
|
||||
}
|
||||
|
||||
|
|
@ -838,7 +838,7 @@ static int x25_wait_for_data(struct sock *sk, long timeout)
|
|||
DECLARE_WAITQUEUE(wait, current);
|
||||
int rc = 0;
|
||||
|
||||
add_wait_queue_exclusive(sk->sk_sleep, &wait);
|
||||
add_wait_queue_exclusive(sk_sleep(sk), &wait);
|
||||
for (;;) {
|
||||
__set_current_state(TASK_INTERRUPTIBLE);
|
||||
if (sk->sk_shutdown & RCV_SHUTDOWN)
|
||||
|
|
@ -858,7 +858,7 @@ static int x25_wait_for_data(struct sock *sk, long timeout)
|
|||
break;
|
||||
}
|
||||
__set_current_state(TASK_RUNNING);
|
||||
remove_wait_queue(sk->sk_sleep, &wait);
|
||||
remove_wait_queue(sk_sleep(sk), &wait);
|
||||
return rc;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue