diff options
author | Herbert Xu <herbert@gondor.apana.org.au> | 2015-11-26 00:55:39 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2015-11-30 14:47:33 -0500 |
commit | 1ce0bf50ae2233c7115a18c0c623662d177b434c (patch) | |
tree | 41860e17fe4b2184055d29e669e503d09796775a /net/core/sock.c | |
parent | c52fd05a2ff2ad20e2a7056baf314c7d1d624ba9 (diff) |
net: Generalise wq_has_sleeper helper
The memory barrier in the helper wq_has_sleeper is needed by just
about every user of waitqueue_active. This patch generalises it
by making it take a wait_queue_head_t directly. The existing
helper is renamed to skwq_has_sleeper.
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/core/sock.c')
-rw-r--r-- | net/core/sock.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/net/core/sock.c b/net/core/sock.c index 1e4dd54bfb5a..2769bd3a4d7c 100644 --- a/net/core/sock.c +++ b/net/core/sock.c | |||
@@ -2283,7 +2283,7 @@ static void sock_def_wakeup(struct sock *sk) | |||
2283 | 2283 | ||
2284 | rcu_read_lock(); | 2284 | rcu_read_lock(); |
2285 | wq = rcu_dereference(sk->sk_wq); | 2285 | wq = rcu_dereference(sk->sk_wq); |
2286 | if (wq_has_sleeper(wq)) | 2286 | if (skwq_has_sleeper(wq)) |
2287 | wake_up_interruptible_all(&wq->wait); | 2287 | wake_up_interruptible_all(&wq->wait); |
2288 | rcu_read_unlock(); | 2288 | rcu_read_unlock(); |
2289 | } | 2289 | } |
@@ -2294,7 +2294,7 @@ static void sock_def_error_report(struct sock *sk) | |||
2294 | 2294 | ||
2295 | rcu_read_lock(); | 2295 | rcu_read_lock(); |
2296 | wq = rcu_dereference(sk->sk_wq); | 2296 | wq = rcu_dereference(sk->sk_wq); |
2297 | if (wq_has_sleeper(wq)) | 2297 | if (skwq_has_sleeper(wq)) |
2298 | wake_up_interruptible_poll(&wq->wait, POLLERR); | 2298 | wake_up_interruptible_poll(&wq->wait, POLLERR); |
2299 | sk_wake_async(sk, SOCK_WAKE_IO, POLL_ERR); | 2299 | sk_wake_async(sk, SOCK_WAKE_IO, POLL_ERR); |
2300 | rcu_read_unlock(); | 2300 | rcu_read_unlock(); |
@@ -2306,7 +2306,7 @@ static void sock_def_readable(struct sock *sk) | |||
2306 | 2306 | ||
2307 | rcu_read_lock(); | 2307 | rcu_read_lock(); |
2308 | wq = rcu_dereference(sk->sk_wq); | 2308 | wq = rcu_dereference(sk->sk_wq); |
2309 | if (wq_has_sleeper(wq)) | 2309 | if (skwq_has_sleeper(wq)) |
2310 | wake_up_interruptible_sync_poll(&wq->wait, POLLIN | POLLPRI | | 2310 | wake_up_interruptible_sync_poll(&wq->wait, POLLIN | POLLPRI | |
2311 | POLLRDNORM | POLLRDBAND); | 2311 | POLLRDNORM | POLLRDBAND); |
2312 | sk_wake_async(sk, SOCK_WAKE_WAITD, POLL_IN); | 2312 | sk_wake_async(sk, SOCK_WAKE_WAITD, POLL_IN); |
@@ -2324,7 +2324,7 @@ static void sock_def_write_space(struct sock *sk) | |||
2324 | */ | 2324 | */ |
2325 | if ((atomic_read(&sk->sk_wmem_alloc) << 1) <= sk->sk_sndbuf) { | 2325 | if ((atomic_read(&sk->sk_wmem_alloc) << 1) <= sk->sk_sndbuf) { |
2326 | wq = rcu_dereference(sk->sk_wq); | 2326 | wq = rcu_dereference(sk->sk_wq); |
2327 | if (wq_has_sleeper(wq)) | 2327 | if (skwq_has_sleeper(wq)) |
2328 | wake_up_interruptible_sync_poll(&wq->wait, POLLOUT | | 2328 | wake_up_interruptible_sync_poll(&wq->wait, POLLOUT | |
2329 | POLLWRNORM | POLLWRBAND); | 2329 | POLLWRNORM | POLLWRBAND); |
2330 | 2330 | ||