diff options
author | Eric Dumazet <edumazet@google.com> | 2019-10-24 01:44:50 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2019-10-28 16:33:41 -0400 |
commit | 3ef7cf57c72f32f61e97f8fa401bc39ea1f1a5d4 (patch) | |
tree | 7f962942a142ed611e6c063171ef0092f8af8fd8 /net/unix/af_unix.c | |
parent | 137a0dbe3426fd7bcfe3f8117b36a87b3590e4eb (diff) |
net: use skb_queue_empty_lockless() in poll() handlers
Many poll() handlers are lockless. Using skb_queue_empty_lockless()
instead of skb_queue_empty() is more appropriate.
Signed-off-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/unix/af_unix.c')
-rw-r--r-- | net/unix/af_unix.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/net/unix/af_unix.c b/net/unix/af_unix.c index 67e87db5877f..0d8da809bea2 100644 --- a/net/unix/af_unix.c +++ b/net/unix/af_unix.c | |||
@@ -2599,7 +2599,7 @@ static __poll_t unix_poll(struct file *file, struct socket *sock, poll_table *wa | |||
2599 | mask |= EPOLLRDHUP | EPOLLIN | EPOLLRDNORM; | 2599 | mask |= EPOLLRDHUP | EPOLLIN | EPOLLRDNORM; |
2600 | 2600 | ||
2601 | /* readable? */ | 2601 | /* readable? */ |
2602 | if (!skb_queue_empty(&sk->sk_receive_queue)) | 2602 | if (!skb_queue_empty_lockless(&sk->sk_receive_queue)) |
2603 | mask |= EPOLLIN | EPOLLRDNORM; | 2603 | mask |= EPOLLIN | EPOLLRDNORM; |
2604 | 2604 | ||
2605 | /* Connection-based need to check for termination and startup */ | 2605 | /* Connection-based need to check for termination and startup */ |
@@ -2628,7 +2628,7 @@ static __poll_t unix_dgram_poll(struct file *file, struct socket *sock, | |||
2628 | mask = 0; | 2628 | mask = 0; |
2629 | 2629 | ||
2630 | /* exceptional events? */ | 2630 | /* exceptional events? */ |
2631 | if (sk->sk_err || !skb_queue_empty(&sk->sk_error_queue)) | 2631 | if (sk->sk_err || !skb_queue_empty_lockless(&sk->sk_error_queue)) |
2632 | mask |= EPOLLERR | | 2632 | mask |= EPOLLERR | |
2633 | (sock_flag(sk, SOCK_SELECT_ERR_QUEUE) ? EPOLLPRI : 0); | 2633 | (sock_flag(sk, SOCK_SELECT_ERR_QUEUE) ? EPOLLPRI : 0); |
2634 | 2634 | ||
@@ -2638,7 +2638,7 @@ static __poll_t unix_dgram_poll(struct file *file, struct socket *sock, | |||
2638 | mask |= EPOLLHUP; | 2638 | mask |= EPOLLHUP; |
2639 | 2639 | ||
2640 | /* readable? */ | 2640 | /* readable? */ |
2641 | if (!skb_queue_empty(&sk->sk_receive_queue)) | 2641 | if (!skb_queue_empty_lockless(&sk->sk_receive_queue)) |
2642 | mask |= EPOLLIN | EPOLLRDNORM; | 2642 | mask |= EPOLLIN | EPOLLRDNORM; |
2643 | 2643 | ||
2644 | /* Connection-based need to check for termination and startup */ | 2644 | /* Connection-based need to check for termination and startup */ |