Commit 5426a4ef authored by Paolo Abeni's avatar Paolo Abeni Committed by David S. Miller

mptcp: avoid additional indirection in mptcp_poll()

We are going to remove the first subflow socket soon, so avoid
the additional indirection at poll() time. Instead access
directly the first subflow sock.

No functional changes intended.
Signed-off-by: default avatarPaolo Abeni <pabeni@redhat.com>
Reviewed-by: default avatarMat Martineau <martineau@kernel.org>
Signed-off-by: default avatarMatthieu Baerts <matthieu.baerts@tessares.net>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 40f56d0c
...@@ -3844,12 +3844,12 @@ static __poll_t mptcp_poll(struct file *file, struct socket *sock, ...@@ -3844,12 +3844,12 @@ static __poll_t mptcp_poll(struct file *file, struct socket *sock,
state = inet_sk_state_load(sk); state = inet_sk_state_load(sk);
pr_debug("msk=%p state=%d flags=%lx", msk, state, msk->flags); pr_debug("msk=%p state=%d flags=%lx", msk, state, msk->flags);
if (state == TCP_LISTEN) { if (state == TCP_LISTEN) {
struct socket *ssock = READ_ONCE(msk->subflow); struct sock *ssk = READ_ONCE(msk->first);
if (WARN_ON_ONCE(!ssock || !ssock->sk)) if (WARN_ON_ONCE(!ssk))
return 0; return 0;
return inet_csk_listen_poll(ssock->sk); return inet_csk_listen_poll(ssk);
} }
shutdown = READ_ONCE(sk->sk_shutdown); shutdown = READ_ONCE(sk->sk_shutdown);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment