summaryrefslogtreecommitdiffstats
path: root/include/net/sock.h
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2018-07-30 09:42:10 +0200
committerDavid S. Miller <davem@davemloft.net>2018-07-30 09:10:25 -0700
commitdd979b4df817e9976f18fb6f9d134d6bc4a3c317 (patch)
treefffcfba952d7c3d86fbecaf5a14a213bd0d54967 /include/net/sock.h
parent3f6bcc5162a1ba4e99e867364919168c1d821308 (diff)
downloadlinux-dd979b4df817e9976f18fb6f9d134d6bc4a3c317.tar.bz2
net: simplify sock_poll_wait
The wait_address argument is always directly derived from the filp argument, so remove it. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/net/sock.h')
-rw-r--r--include/net/sock.h11
1 files changed, 6 insertions, 5 deletions
diff --git a/include/net/sock.h b/include/net/sock.h
index 83b747538bd0..0518f61926ec 100644
--- a/include/net/sock.h
+++ b/include/net/sock.h
@@ -2057,16 +2057,17 @@ static inline bool skwq_has_sleeper(struct socket_wq *wq)
/**
* sock_poll_wait - place memory barrier behind the poll_wait call.
* @filp: file
- * @wait_address: socket wait queue
* @p: poll_table
*
* See the comments in the wq_has_sleeper function.
*/
-static inline void sock_poll_wait(struct file *filp,
- wait_queue_head_t *wait_address, poll_table *p)
+static inline void sock_poll_wait(struct file *filp, poll_table *p)
{
- if (!poll_does_not_wait(p) && wait_address) {
- poll_wait(filp, wait_address, 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);
/* We need to be sure we are in sync with the
* socket flags modification.
*