Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d8bbd13b authored by Christoph Hellwig's avatar Christoph Hellwig Committed by David S. Miller
Browse files

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: default avatarChristoph Hellwig <hch@lst.de>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent dd979b4d
Loading
Loading
Loading
Loading
+2 −3
Original line number Diff line number Diff line
@@ -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.
		 *