diff options
| author | David S. Miller <davem@davemloft.net> | 2018-07-30 09:10:25 -0700 |
|---|---|---|
| committer | David S. Miller <davem@davemloft.net> | 2018-07-30 09:10:25 -0700 |
| commit | b0a0381987dd2be9eb95f7415b110dbb0a7dbe4a (patch) | |
| tree | 307bcd2465bd96bc79cecf60abf50630538117a8 /include | |
| parent | 3f6bcc5162a1ba4e99e867364919168c1d821308 (diff) | |
| parent | a331de3bf0e66ab2437fc8c5b99bd3c0d9da3088 (diff) | |
Merge branch 'socket-poll-related-cleanups-v2'
Christoph Hellwig says:
====================
socket poll related cleanups v2
A couple of cleanups I stumbled upon when studying the networking
poll code.
Changes since v1:
- drop a dispute patch from this series (to be sent separately)
====================
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include')
| -rw-r--r-- | include/net/busy_poll.h | 15 | ||||
| -rw-r--r-- | include/net/sock.h | 10 |
2 files changed, 5 insertions, 20 deletions
diff --git a/include/net/busy_poll.h b/include/net/busy_poll.h index 9e36fda652b7..ba61cdd09eaa 100644 --- a/include/net/busy_poll.h +++ b/include/net/busy_poll.h @@ -121,21 +121,6 @@ static inline void sk_busy_loop(struct sock *sk, int nonblock) #endif } -static inline void sock_poll_busy_loop(struct socket *sock, __poll_t events) -{ - if (sk_can_busy_loop(sock->sk) && - events && (events & POLL_BUSY_LOOP)) { - /* once, only if requested by syscall */ - sk_busy_loop(sock->sk, 1); - } -} - -/* if this socket can poll_ll, tell the system call */ -static inline __poll_t sock_poll_busy_flag(struct socket *sock) -{ - return sk_can_busy_loop(sock->sk) ? POLL_BUSY_LOOP : 0; -} - /* used in the NIC receive handler to mark the skb */ static inline void skb_mark_napi_id(struct sk_buff *skb, struct napi_struct *napi) diff --git a/include/net/sock.h b/include/net/sock.h index 83b747538bd0..2afea5d1bdfe 100644 --- a/include/net/sock.h +++ b/include/net/sock.h @@ -2057,16 +2057,16 @@ 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; + + 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. * |
