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:
Linus Torvalds
2018-02-11 14:34:03 -08:00
förälder ee5daa1361
incheckning a9a08845e9
297 ändrade filer med 913 tillägg och 913 borttagningar

Visa fil

@@ -731,12 +731,12 @@ capi_poll(struct file *file, poll_table *wait)
__poll_t mask = 0;
if (!cdev->ap.applid)
return POLLERR;
return EPOLLERR;
poll_wait(file, &(cdev->recvwait), wait);
mask = POLLOUT | POLLWRNORM;
mask = EPOLLOUT | EPOLLWRNORM;
if (!skb_queue_empty(&cdev->recvqueue))
mask |= POLLIN | POLLRDNORM;
mask |= EPOLLIN | EPOLLRDNORM;
return mask;
}

Visa fil

@@ -125,9 +125,9 @@ isdn_divert_poll(struct file *file, poll_table *wait)
__poll_t mask = 0;
poll_wait(file, &(rd_queue), wait);
/* mask = POLLOUT | POLLWRNORM; */
/* mask = EPOLLOUT | EPOLLWRNORM; */
if (*((struct divert_info **) file->private_data)) {
mask |= POLLIN | POLLRDNORM;
mask |= EPOLLIN | EPOLLRDNORM;
}
return mask;
} /* isdn_divert_poll */

Visa fil

@@ -103,9 +103,9 @@ static __poll_t maint_poll(struct file *file, poll_table *wait)
__poll_t mask = 0;
poll_wait(file, &msgwaitq, wait);
mask = POLLOUT | POLLWRNORM;
mask = EPOLLOUT | EPOLLWRNORM;
if (file->private_data || diva_dbg_q_length()) {
mask |= POLLIN | POLLRDNORM;
mask |= EPOLLIN | EPOLLRDNORM;
}
return (mask);
}

Visa fil

@@ -370,31 +370,31 @@ static __poll_t um_idi_poll(struct file *file, poll_table *wait)
diva_um_idi_os_context_t *p_os;
if (!file->private_data) {
return (POLLERR);
return (EPOLLERR);
}
if ((!(p_os =
(diva_um_idi_os_context_t *)
diva_um_id_get_os_context(file->private_data)))
|| p_os->aborted) {
return (POLLERR);
return (EPOLLERR);
}
poll_wait(file, &p_os->read_wait, wait);
if (p_os->aborted) {
return (POLLERR);
return (EPOLLERR);
}
switch (diva_user_mode_idi_ind_ready(file->private_data, file)) {
case (-1):
return (POLLERR);
return (EPOLLERR);
case 0:
return (0);
}
return (POLLIN | POLLRDNORM);
return (EPOLLIN | EPOLLRDNORM);
}
static int um_idi_open(struct inode *inode, struct file *file)

Visa fil

@@ -653,9 +653,9 @@ static ssize_t divas_read(struct file *file, char __user *buf,
static __poll_t divas_poll(struct file *file, poll_table *wait)
{
if (!file->private_data) {
return (POLLERR);
return (EPOLLERR);
}
return (POLLIN | POLLRDNORM);
return (EPOLLIN | EPOLLRDNORM);
}
static const struct file_operations divas_fops = {

Visa fil

@@ -101,7 +101,7 @@ divas_write(struct file *file, const char __user *buf, size_t count, loff_t *off
static __poll_t divas_poll(struct file *file, poll_table *wait)
{
return (POLLERR);
return (EPOLLERR);
}
static int divas_open(struct inode *inode, struct file *file)

Visa fil

@@ -294,7 +294,7 @@ hysdn_log_poll(struct file *file, poll_table *wait)
poll_wait(file, &(pd->rd_queue), wait);
if (*((struct log_data **) file->private_data))
mask |= POLLIN | POLLRDNORM;
mask |= EPOLLIN | EPOLLRDNORM;
return mask;
} /* hysdn_log_poll */

Visa fil

@@ -1237,22 +1237,22 @@ isdn_poll(struct file *file, poll_table *wait)
mutex_lock(&isdn_mutex);
if (minor == ISDN_MINOR_STATUS) {
poll_wait(file, &(dev->info_waitq), wait);
/* mask = POLLOUT | POLLWRNORM; */
/* mask = EPOLLOUT | EPOLLWRNORM; */
if (file->private_data) {
mask |= POLLIN | POLLRDNORM;
mask |= EPOLLIN | EPOLLRDNORM;
}
goto out;
}
if (minor >= ISDN_MINOR_CTRL && minor <= ISDN_MINOR_CTRLMAX) {
if (drvidx < 0) {
/* driver deregistered while file open */
mask = POLLHUP;
mask = EPOLLHUP;
goto out;
}
poll_wait(file, &(dev->drv[drvidx]->st_waitq), wait);
mask = POLLOUT | POLLWRNORM;
mask = EPOLLOUT | EPOLLWRNORM;
if (dev->drv[drvidx]->stavail) {
mask |= POLLIN | POLLRDNORM;
mask |= EPOLLIN | EPOLLRDNORM;
}
goto out;
}
@@ -1262,7 +1262,7 @@ isdn_poll(struct file *file, poll_table *wait)
goto out;
}
#endif
mask = POLLERR;
mask = EPOLLERR;
out:
mutex_unlock(&isdn_mutex);
return mask;

Visa fil

@@ -704,12 +704,12 @@ isdn_ppp_poll(struct file *file, poll_table *wait)
if (!(is->state & IPPP_OPEN)) {
if (is->state == IPPP_CLOSEWAIT)
return POLLHUP;
return EPOLLHUP;
printk(KERN_DEBUG "isdn_ppp: device not open\n");
return POLLERR;
return EPOLLERR;
}
/* we're always ready to send .. */
mask = POLLOUT | POLLWRNORM;
mask = EPOLLOUT | EPOLLWRNORM;
spin_lock_irqsave(&is->buflock, flags);
bl = is->last;
@@ -719,7 +719,7 @@ isdn_ppp_poll(struct file *file, poll_table *wait)
*/
if (bf->next != bl || (is->state & IPPP_NOBLOCK)) {
is->state &= ~IPPP_NOBLOCK;
mask |= POLLIN | POLLRDNORM;
mask |= EPOLLIN | EPOLLRDNORM;
}
spin_unlock_irqrestore(&is->buflock, flags);
return mask;

Visa fil

@@ -145,7 +145,7 @@ static __poll_t
mISDN_poll(struct file *filep, poll_table *wait)
{
struct mISDNtimerdev *dev = filep->private_data;
__poll_t mask = POLLERR;
__poll_t mask = EPOLLERR;
if (*debug & DEBUG_TIMER)
printk(KERN_DEBUG "%s(%p, %p)\n", __func__, filep, wait);
@@ -153,7 +153,7 @@ mISDN_poll(struct file *filep, poll_table *wait)
poll_wait(filep, &dev->wait, wait);
mask = 0;
if (dev->work || !list_empty(&dev->expired))
mask |= (POLLIN | POLLRDNORM);
mask |= (EPOLLIN | EPOLLRDNORM);
if (*debug & DEBUG_TIMER)
printk(KERN_DEBUG "%s work(%d) empty(%d)\n", __func__,
dev->work, list_empty(&dev->expired));