summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2018-07-30 09:42:11 +0200
committerDavid S. Miller <davem@davemloft.net>2018-07-30 09:10:25 -0700
commitd8bbd13beeaacd6494954bf5b945b54ccb2af309 (patch)
treee3c719c6148c5a38aedc727618122e3e6e2a6b04 /include
parentdd979b4df817e9976f18fb6f9d134d6bc4a3c317 (diff)
downloadlinux-stable-d8bbd13beeaacd6494954bf5b945b54ccb2af309.tar.gz
linux-stable-d8bbd13beeaacd6494954bf5b945b54ccb2af309.tar.bz2
linux-stable-d8bbd13beeaacd6494954bf5b945b54ccb2af309.zip
net: don not detour through struct sock to find the poll waitqueue
For any open socket file descriptor sock->sk->sk_wq->wait will always point to sock->wq->wait. That means we can do the shorter dereference and removal a NULL check and don't have to not worry about any RCU protection. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include')
-rw-r--r--include/net/sock.h5
1 files changed, 2 insertions, 3 deletions
diff --git a/include/net/sock.h b/include/net/sock.h
index 0518f61926ec..2afea5d1bdfe 100644
--- a/include/net/sock.h
+++ b/include/net/sock.h
@@ -2064,10 +2064,9 @@ static inline bool skwq_has_sleeper(struct socket_wq *wq)
static inline void sock_poll_wait(struct file *filp, poll_table *p)
{
struct socket *sock = filp->private_data;
- wait_queue_head_t *wq = sk_sleep(sock->sk);
- if (!poll_does_not_wait(p) && wq) {
- poll_wait(filp, wq, p);
+ if (!poll_does_not_wait(p)) {
+ poll_wait(filp, &sock->wq->wait, p);
/* We need to be sure we are in sync with the
* socket flags modification.
*