Skip to content

Commit d8bbd13

Browse files
Christoph Hellwigdavem330
authored andcommitted
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>
1 parent dd979b4 commit d8bbd13

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

‎include/net/sock.h‎

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2064,10 +2064,9 @@ static inline bool skwq_has_sleeper(struct socket_wq *wq)
20642064
static inline void sock_poll_wait(struct file *filp, poll_table *p)
20652065
{
20662066
struct socket *sock = filp->private_data;
2067-
wait_queue_head_t *wq = sk_sleep(sock->sk);
20682067

2069-
if (!poll_does_not_wait(p) && wq) {
2070-
poll_wait(filp, wq, p);
2068+
if (!poll_does_not_wait(p)) {
2069+
poll_wait(filp, &sock->wq->wait, p);
20712070
/* We need to be sure we are in sync with the
20722071
* socket flags modification.
20732072
*

0 commit comments

Comments
 (0)