Skip to content

Commit f641f13

Browse files
Christoph Hellwigdavem330
authored andcommitted
net: remove sock_poll_busy_loop
There is no point in hiding this logic in a helper. Also remove the useless events != 0 check and only busy loop once we know we actually have a poll method. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent d8bbd13 commit f641f13

2 files changed

Lines changed: 4 additions & 10 deletions

File tree

‎include/net/busy_poll.h‎

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -121,15 +121,6 @@ static inline void sk_busy_loop(struct sock *sk, int nonblock)
121121
#endif
122122
}
123123

124-
static inline void sock_poll_busy_loop(struct socket *sock, __poll_t events)
125-
{
126-
if (sk_can_busy_loop(sock->sk) &&
127-
events && (events & POLL_BUSY_LOOP)) {
128-
/* once, only if requested by syscall */
129-
sk_busy_loop(sock->sk, 1);
130-
}
131-
}
132-
133124
/* if this socket can poll_ll, tell the system call */
134125
static inline __poll_t sock_poll_busy_flag(struct socket *sock)
135126
{

‎net/socket.c‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1132,9 +1132,12 @@ static __poll_t sock_poll(struct file *file, poll_table *wait)
11321132
struct socket *sock = file->private_data;
11331133
__poll_t events = poll_requested_events(wait);
11341134

1135-
sock_poll_busy_loop(sock, events);
11361135
if (!sock->ops->poll)
11371136
return 0;
1137+
1138+
/* poll once if requested by the syscall */
1139+
if (sk_can_busy_loop(sock->sk) && (events & POLL_BUSY_LOOP))
1140+
sk_busy_loop(sock->sk, 1);
11381141
return sock->ops->poll(file, sock, wait) | sock_poll_busy_flag(sock);
11391142
}
11401143

0 commit comments

Comments
 (0)