mirror of
https://gitee.com/bianbu-linux/linux-6.6
synced 2025-04-24 14:07:52 -04:00
vfs: do bulk POLL* -> EPOLL* replacement
This is the mindless scripted replacement of kernel use of POLL* variables as described by Al, done by this script: for V in IN OUT PRI ERR RDNORM RDBAND WRNORM WRBAND HUP RDHUP NVAL MSG; do L=`git grep -l -w POLL$V | grep -v '^t' | grep -v /um/ | grep -v '^sa' | grep -v '/poll.h$'|grep -v '^D'` for f in $L; do sed -i "-es/^\([^\"]*\)\(\<POLL$V\>\)/\\1E\\2/" $f; done done with de-mangling cleanups yet to come. NOTE! On almost all architectures, the EPOLL* constants have the same values as the POLL* constants do. But they keyword here is "almost". For various bad reasons they aren't the same, and epoll() doesn't actually work quite correctly in some cases due to this on Sparc et al. The next patch from Al will sort out the final differences, and we should be all done. Scripted-by: Al Viro <viro@zeniv.linux.org.uk> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
parent
ee5daa1361
commit
a9a08845e9
297 changed files with 913 additions and 913 deletions
|
@ -415,9 +415,9 @@ static void unix_dgram_peer_wake_disconnect_wakeup(struct sock *sk,
|
|||
{
|
||||
unix_dgram_peer_wake_disconnect(sk, other);
|
||||
wake_up_interruptible_poll(sk_sleep(sk),
|
||||
POLLOUT |
|
||||
POLLWRNORM |
|
||||
POLLWRBAND);
|
||||
EPOLLOUT |
|
||||
EPOLLWRNORM |
|
||||
EPOLLWRBAND);
|
||||
}
|
||||
|
||||
/* preconditions:
|
||||
|
@ -454,7 +454,7 @@ static void unix_write_space(struct sock *sk)
|
|||
wq = rcu_dereference(sk->sk_wq);
|
||||
if (skwq_has_sleeper(wq))
|
||||
wake_up_interruptible_sync_poll(&wq->wait,
|
||||
POLLOUT | POLLWRNORM | POLLWRBAND);
|
||||
EPOLLOUT | EPOLLWRNORM | EPOLLWRBAND);
|
||||
sk_wake_async(sk, SOCK_WAKE_SPACE, POLL_OUT);
|
||||
}
|
||||
rcu_read_unlock();
|
||||
|
@ -2129,8 +2129,8 @@ static int unix_dgram_recvmsg(struct socket *sock, struct msghdr *msg,
|
|||
|
||||
if (wq_has_sleeper(&u->peer_wait))
|
||||
wake_up_interruptible_sync_poll(&u->peer_wait,
|
||||
POLLOUT | POLLWRNORM |
|
||||
POLLWRBAND);
|
||||
EPOLLOUT | EPOLLWRNORM |
|
||||
EPOLLWRBAND);
|
||||
|
||||
if (msg->msg_name)
|
||||
unix_copy_addr(msg, skb->sk);
|
||||
|
@ -2650,27 +2650,27 @@ static __poll_t unix_poll(struct file *file, struct socket *sock, poll_table *wa
|
|||
|
||||
/* exceptional events? */
|
||||
if (sk->sk_err)
|
||||
mask |= POLLERR;
|
||||
mask |= EPOLLERR;
|
||||
if (sk->sk_shutdown == SHUTDOWN_MASK)
|
||||
mask |= POLLHUP;
|
||||
mask |= EPOLLHUP;
|
||||
if (sk->sk_shutdown & RCV_SHUTDOWN)
|
||||
mask |= POLLRDHUP | POLLIN | POLLRDNORM;
|
||||
mask |= EPOLLRDHUP | EPOLLIN | EPOLLRDNORM;
|
||||
|
||||
/* readable? */
|
||||
if (!skb_queue_empty(&sk->sk_receive_queue))
|
||||
mask |= POLLIN | POLLRDNORM;
|
||||
mask |= EPOLLIN | EPOLLRDNORM;
|
||||
|
||||
/* Connection-based need to check for termination and startup */
|
||||
if ((sk->sk_type == SOCK_STREAM || sk->sk_type == SOCK_SEQPACKET) &&
|
||||
sk->sk_state == TCP_CLOSE)
|
||||
mask |= POLLHUP;
|
||||
mask |= EPOLLHUP;
|
||||
|
||||
/*
|
||||
* we set writable also when the other side has shut down the
|
||||
* connection. This prevents stuck sockets.
|
||||
*/
|
||||
if (unix_writable(sk))
|
||||
mask |= POLLOUT | POLLWRNORM | POLLWRBAND;
|
||||
mask |= EPOLLOUT | EPOLLWRNORM | EPOLLWRBAND;
|
||||
|
||||
return mask;
|
||||
}
|
||||
|
@ -2687,29 +2687,29 @@ static __poll_t unix_dgram_poll(struct file *file, struct socket *sock,
|
|||
|
||||
/* exceptional events? */
|
||||
if (sk->sk_err || !skb_queue_empty(&sk->sk_error_queue))
|
||||
mask |= POLLERR |
|
||||
(sock_flag(sk, SOCK_SELECT_ERR_QUEUE) ? POLLPRI : 0);
|
||||
mask |= EPOLLERR |
|
||||
(sock_flag(sk, SOCK_SELECT_ERR_QUEUE) ? EPOLLPRI : 0);
|
||||
|
||||
if (sk->sk_shutdown & RCV_SHUTDOWN)
|
||||
mask |= POLLRDHUP | POLLIN | POLLRDNORM;
|
||||
mask |= EPOLLRDHUP | EPOLLIN | EPOLLRDNORM;
|
||||
if (sk->sk_shutdown == SHUTDOWN_MASK)
|
||||
mask |= POLLHUP;
|
||||
mask |= EPOLLHUP;
|
||||
|
||||
/* readable? */
|
||||
if (!skb_queue_empty(&sk->sk_receive_queue))
|
||||
mask |= POLLIN | POLLRDNORM;
|
||||
mask |= EPOLLIN | EPOLLRDNORM;
|
||||
|
||||
/* Connection-based need to check for termination and startup */
|
||||
if (sk->sk_type == SOCK_SEQPACKET) {
|
||||
if (sk->sk_state == TCP_CLOSE)
|
||||
mask |= POLLHUP;
|
||||
mask |= EPOLLHUP;
|
||||
/* connection hasn't started yet? */
|
||||
if (sk->sk_state == TCP_SYN_SENT)
|
||||
return mask;
|
||||
}
|
||||
|
||||
/* No write status requested, avoid expensive OUT tests. */
|
||||
if (!(poll_requested_events(wait) & (POLLWRBAND|POLLWRNORM|POLLOUT)))
|
||||
if (!(poll_requested_events(wait) & (EPOLLWRBAND|EPOLLWRNORM|EPOLLOUT)))
|
||||
return mask;
|
||||
|
||||
writable = unix_writable(sk);
|
||||
|
@ -2726,7 +2726,7 @@ static __poll_t unix_dgram_poll(struct file *file, struct socket *sock,
|
|||
}
|
||||
|
||||
if (writable)
|
||||
mask |= POLLOUT | POLLWRNORM | POLLWRBAND;
|
||||
mask |= EPOLLOUT | EPOLLWRNORM | EPOLLWRBAND;
|
||||
else
|
||||
sk_set_bit(SOCKWQ_ASYNC_NOSPACE, sk);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue