Skip to content

Commit a9a0884

Browse files
committed
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 <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
1 parent ee5daa1 commit a9a0884

File tree

297 files changed

+913
-913
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

297 files changed

+913
-913
lines changed

arch/cris/arch-v10/drivers/gpio.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ static __poll_t gpio_poll(struct file *file, poll_table *wait)
173173

174174
if ((data & priv->highalarm) ||
175175
(~data & priv->lowalarm)) {
176-
mask = POLLIN|POLLRDNORM;
176+
mask = EPOLLIN|EPOLLRDNORM;
177177
}
178178

179179
out:

arch/cris/arch-v10/drivers/sync_serial.c

+4-4
Original file line numberDiff line numberDiff line change
@@ -666,16 +666,16 @@ static __poll_t sync_serial_poll(struct file *file, poll_table *wait)
666666
poll_wait(file, &port->in_wait_q, wait);
667667
/* Some room to write */
668668
if (port->out_count < OUT_BUFFER_SIZE)
669-
mask |= POLLOUT | POLLWRNORM;
669+
mask |= EPOLLOUT | EPOLLWRNORM;
670670
/* At least an inbufchunk of data */
671671
if (sync_data_avail(port) >= port->inbufchunk)
672-
mask |= POLLIN | POLLRDNORM;
672+
mask |= EPOLLIN | EPOLLRDNORM;
673673

674674
DEBUGPOLL(if (mask != prev_mask)
675675
printk(KERN_DEBUG "sync_serial_poll: mask 0x%08X %s %s\n",
676676
mask,
677-
mask & POLLOUT ? "POLLOUT" : "",
678-
mask & POLLIN ? "POLLIN" : "");
677+
mask & EPOLLOUT ? "POLLOUT" : "",
678+
mask & EPOLLIN ? "POLLIN" : "");
679679
prev_mask = mask;
680680
);
681681
return mask;

arch/cris/arch-v32/drivers/sync_serial.c

+5-5
Original file line numberDiff line numberDiff line change
@@ -574,24 +574,24 @@ static __poll_t sync_serial_poll(struct file *file, poll_table *wait)
574574

575575
/* No active transfer, descriptors are available */
576576
if (port->output && !port->tr_running)
577-
mask |= POLLOUT | POLLWRNORM;
577+
mask |= EPOLLOUT | EPOLLWRNORM;
578578

579579
/* Descriptor and buffer space available. */
580580
if (port->output &&
581581
port->active_tr_descr != port->catch_tr_descr &&
582582
port->out_buf_count < OUT_BUFFER_SIZE)
583-
mask |= POLLOUT | POLLWRNORM;
583+
mask |= EPOLLOUT | EPOLLWRNORM;
584584

585585
/* At least an inbufchunk of data */
586586
if (port->input && sync_data_avail(port) >= port->inbufchunk)
587-
mask |= POLLIN | POLLRDNORM;
587+
mask |= EPOLLIN | EPOLLRDNORM;
588588

589589
DEBUGPOLL(
590590
if (mask != prev_mask)
591591
pr_info("sync_serial_poll: mask 0x%08X %s %s\n",
592592
mask,
593-
mask & POLLOUT ? "POLLOUT" : "",
594-
mask & POLLIN ? "POLLIN" : "");
593+
mask & EPOLLOUT ? "POLLOUT" : "",
594+
mask & EPOLLIN ? "POLLIN" : "");
595595
prev_mask = mask;
596596
);
597597
return mask;

arch/ia64/kernel/perfmon.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -1670,7 +1670,7 @@ pfm_poll(struct file *filp, poll_table * wait)
16701670
PROTECT_CTX(ctx, flags);
16711671

16721672
if (PFM_CTXQ_EMPTY(ctx) == 0)
1673-
mask = POLLIN | POLLRDNORM;
1673+
mask = EPOLLIN | EPOLLRDNORM;
16741674

16751675
UNPROTECT_CTX(ctx, flags);
16761676

arch/mips/kernel/rtlx.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -349,11 +349,11 @@ static __poll_t file_poll(struct file *file, poll_table *wait)
349349

350350
/* data available to read? */
351351
if (rtlx_read_poll(minor, 0))
352-
mask |= POLLIN | POLLRDNORM;
352+
mask |= EPOLLIN | EPOLLRDNORM;
353353

354354
/* space to write */
355355
if (rtlx_write_poll(minor))
356-
mask |= POLLOUT | POLLWRNORM;
356+
mask |= EPOLLOUT | EPOLLWRNORM;
357357

358358
return mask;
359359
}

arch/powerpc/kernel/rtasd.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -392,7 +392,7 @@ static __poll_t rtas_log_poll(struct file *file, poll_table * wait)
392392
{
393393
poll_wait(file, &rtas_log_wait, wait);
394394
if (rtas_log_size)
395-
return POLLIN | POLLRDNORM;
395+
return EPOLLIN | EPOLLRDNORM;
396396
return 0;
397397
}
398398

arch/powerpc/platforms/cell/spufs/backing_ops.c

+4-4
Original file line numberDiff line numberDiff line change
@@ -101,19 +101,19 @@ static __poll_t spu_backing_mbox_stat_poll(struct spu_context *ctx,
101101
but first mark any pending interrupts as done so
102102
we don't get woken up unnecessarily */
103103

104-
if (events & (POLLIN | POLLRDNORM)) {
104+
if (events & (EPOLLIN | EPOLLRDNORM)) {
105105
if (stat & 0xff0000)
106-
ret |= POLLIN | POLLRDNORM;
106+
ret |= EPOLLIN | EPOLLRDNORM;
107107
else {
108108
ctx->csa.priv1.int_stat_class2_RW &=
109109
~CLASS2_MAILBOX_INTR;
110110
ctx->csa.priv1.int_mask_class2_RW |=
111111
CLASS2_ENABLE_MAILBOX_INTR;
112112
}
113113
}
114-
if (events & (POLLOUT | POLLWRNORM)) {
114+
if (events & (EPOLLOUT | EPOLLWRNORM)) {
115115
if (stat & 0x00ff00)
116-
ret = POLLOUT | POLLWRNORM;
116+
ret = EPOLLOUT | EPOLLWRNORM;
117117
else {
118118
ctx->csa.priv1.int_stat_class2_RW &=
119119
~CLASS2_MAILBOX_THRESHOLD_INTR;

arch/powerpc/platforms/cell/spufs/file.c

+5-5
Original file line numberDiff line numberDiff line change
@@ -774,7 +774,7 @@ static __poll_t spufs_ibox_poll(struct file *file, poll_table *wait)
774774
* that poll should not sleep. Will be fixed later.
775775
*/
776776
mutex_lock(&ctx->state_mutex);
777-
mask = ctx->ops->mbox_stat_poll(ctx, POLLIN | POLLRDNORM);
777+
mask = ctx->ops->mbox_stat_poll(ctx, EPOLLIN | EPOLLRDNORM);
778778
spu_release(ctx);
779779

780780
return mask;
@@ -910,7 +910,7 @@ static __poll_t spufs_wbox_poll(struct file *file, poll_table *wait)
910910
* that poll should not sleep. Will be fixed later.
911911
*/
912912
mutex_lock(&ctx->state_mutex);
913-
mask = ctx->ops->mbox_stat_poll(ctx, POLLOUT | POLLWRNORM);
913+
mask = ctx->ops->mbox_stat_poll(ctx, EPOLLOUT | EPOLLWRNORM);
914914
spu_release(ctx);
915915

916916
return mask;
@@ -1710,9 +1710,9 @@ static __poll_t spufs_mfc_poll(struct file *file,poll_table *wait)
17101710

17111711
mask = 0;
17121712
if (free_elements & 0xffff)
1713-
mask |= POLLOUT | POLLWRNORM;
1713+
mask |= EPOLLOUT | EPOLLWRNORM;
17141714
if (tagstatus & ctx->tagwait)
1715-
mask |= POLLIN | POLLRDNORM;
1715+
mask |= EPOLLIN | EPOLLRDNORM;
17161716

17171717
pr_debug("%s: free %d tagstatus %d tagwait %d\n", __func__,
17181718
free_elements, tagstatus, ctx->tagwait);
@@ -2469,7 +2469,7 @@ static __poll_t spufs_switch_log_poll(struct file *file, poll_table *wait)
24692469
return rc;
24702470

24712471
if (spufs_switch_log_used(ctx) > 0)
2472-
mask |= POLLIN;
2472+
mask |= EPOLLIN;
24732473

24742474
spu_release(ctx);
24752475

arch/powerpc/platforms/cell/spufs/hw_ops.c

+4-4
Original file line numberDiff line numberDiff line change
@@ -70,17 +70,17 @@ static __poll_t spu_hw_mbox_stat_poll(struct spu_context *ctx, __poll_t events)
7070
but first mark any pending interrupts as done so
7171
we don't get woken up unnecessarily */
7272

73-
if (events & (POLLIN | POLLRDNORM)) {
73+
if (events & (EPOLLIN | EPOLLRDNORM)) {
7474
if (stat & 0xff0000)
75-
ret |= POLLIN | POLLRDNORM;
75+
ret |= EPOLLIN | EPOLLRDNORM;
7676
else {
7777
spu_int_stat_clear(spu, 2, CLASS2_MAILBOX_INTR);
7878
spu_int_mask_or(spu, 2, CLASS2_ENABLE_MAILBOX_INTR);
7979
}
8080
}
81-
if (events & (POLLOUT | POLLWRNORM)) {
81+
if (events & (EPOLLOUT | EPOLLWRNORM)) {
8282
if (stat & 0x00ff00)
83-
ret = POLLOUT | POLLWRNORM;
83+
ret = EPOLLOUT | EPOLLWRNORM;
8484
else {
8585
spu_int_stat_clear(spu, 2,
8686
CLASS2_MAILBOX_THRESHOLD_INTR);

arch/powerpc/platforms/powernv/opal-prd.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ static __poll_t opal_prd_poll(struct file *file,
153153
poll_wait(file, &opal_prd_msg_wait, wait);
154154

155155
if (!opal_msg_queue_empty())
156-
return POLLIN | POLLRDNORM;
156+
return EPOLLIN | EPOLLRDNORM;
157157

158158
return 0;
159159
}

arch/x86/kernel/apm_32.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -1515,7 +1515,7 @@ static __poll_t do_poll(struct file *fp, poll_table *wait)
15151515
return 0;
15161516
poll_wait(fp, &apm_waitqueue, wait);
15171517
if (!queue_empty(as))
1518-
return POLLIN | POLLRDNORM;
1518+
return EPOLLIN | EPOLLRDNORM;
15191519
return 0;
15201520
}
15211521

arch/x86/kernel/cpu/mcheck/dev-mcelog.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -247,9 +247,9 @@ static __poll_t mce_chrdev_poll(struct file *file, poll_table *wait)
247247
{
248248
poll_wait(file, &mce_chrdev_wait, wait);
249249
if (READ_ONCE(mcelog.next))
250-
return POLLIN | POLLRDNORM;
250+
return EPOLLIN | EPOLLRDNORM;
251251
if (!mce_apei_read_done && apei_check_mce())
252-
return POLLIN | POLLRDNORM;
252+
return EPOLLIN | EPOLLRDNORM;
253253
return 0;
254254
}
255255

block/bsg.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -849,9 +849,9 @@ static __poll_t bsg_poll(struct file *file, poll_table *wait)
849849

850850
spin_lock_irq(&bd->lock);
851851
if (!list_empty(&bd->done_list))
852-
mask |= POLLIN | POLLRDNORM;
852+
mask |= EPOLLIN | EPOLLRDNORM;
853853
if (bd->queued_cmds < bd->max_queue)
854-
mask |= POLLOUT;
854+
mask |= EPOLLOUT;
855855
spin_unlock_irq(&bd->lock);
856856

857857
return mask;

crypto/af_alg.c

+8-8
Original file line numberDiff line numberDiff line change
@@ -735,9 +735,9 @@ void af_alg_wmem_wakeup(struct sock *sk)
735735
rcu_read_lock();
736736
wq = rcu_dereference(sk->sk_wq);
737737
if (skwq_has_sleeper(wq))
738-
wake_up_interruptible_sync_poll(&wq->wait, POLLIN |
739-
POLLRDNORM |
740-
POLLRDBAND);
738+
wake_up_interruptible_sync_poll(&wq->wait, EPOLLIN |
739+
EPOLLRDNORM |
740+
EPOLLRDBAND);
741741
sk_wake_async(sk, SOCK_WAKE_WAITD, POLL_IN);
742742
rcu_read_unlock();
743743
}
@@ -800,9 +800,9 @@ void af_alg_data_wakeup(struct sock *sk)
800800
rcu_read_lock();
801801
wq = rcu_dereference(sk->sk_wq);
802802
if (skwq_has_sleeper(wq))
803-
wake_up_interruptible_sync_poll(&wq->wait, POLLOUT |
804-
POLLRDNORM |
805-
POLLRDBAND);
803+
wake_up_interruptible_sync_poll(&wq->wait, EPOLLOUT |
804+
EPOLLRDNORM |
805+
EPOLLRDBAND);
806806
sk_wake_async(sk, SOCK_WAKE_SPACE, POLL_OUT);
807807
rcu_read_unlock();
808808
}
@@ -1076,10 +1076,10 @@ __poll_t af_alg_poll(struct file *file, struct socket *sock,
10761076
mask = 0;
10771077

10781078
if (!ctx->more || ctx->used)
1079-
mask |= POLLIN | POLLRDNORM;
1079+
mask |= EPOLLIN | EPOLLRDNORM;
10801080

10811081
if (af_alg_writable(sk))
1082-
mask |= POLLOUT | POLLWRNORM | POLLWRBAND;
1082+
mask |= EPOLLOUT | EPOLLWRNORM | EPOLLWRBAND;
10831083

10841084
return mask;
10851085
}

drivers/acpi/acpi_dbg.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -724,9 +724,9 @@ static __poll_t acpi_aml_poll(struct file *file, poll_table *wait)
724724

725725
poll_wait(file, &acpi_aml_io.wait, wait);
726726
if (acpi_aml_user_readable())
727-
masks |= POLLIN | POLLRDNORM;
727+
masks |= EPOLLIN | EPOLLRDNORM;
728728
if (acpi_aml_user_writable())
729-
masks |= POLLOUT | POLLWRNORM;
729+
masks |= EPOLLOUT | EPOLLWRNORM;
730730

731731
return masks;
732732
}

drivers/android/binder.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -4371,7 +4371,7 @@ static int binder_thread_release(struct binder_proc *proc,
43714371
*/
43724372
if ((thread->looper & BINDER_LOOPER_STATE_POLL) &&
43734373
waitqueue_active(&thread->wait)) {
4374-
wake_up_poll(&thread->wait, POLLHUP | POLLFREE);
4374+
wake_up_poll(&thread->wait, EPOLLHUP | POLLFREE);
43754375
}
43764376

43774377
binder_inner_proc_unlock(thread->proc);
@@ -4401,7 +4401,7 @@ static __poll_t binder_poll(struct file *filp,
44014401
poll_wait(filp, &thread->wait, wait);
44024402

44034403
if (binder_has_work(thread, wait_for_proc_work))
4404-
return POLLIN;
4404+
return EPOLLIN;
44054405

44064406
return 0;
44074407
}

drivers/bluetooth/hci_vhci.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -306,9 +306,9 @@ static __poll_t vhci_poll(struct file *file, poll_table *wait)
306306
poll_wait(file, &data->read_wait, wait);
307307

308308
if (!skb_queue_empty(&data->readq))
309-
return POLLIN | POLLRDNORM;
309+
return EPOLLIN | EPOLLRDNORM;
310310

311-
return POLLOUT | POLLWRNORM;
311+
return EPOLLOUT | EPOLLWRNORM;
312312
}
313313

314314
static void vhci_open_timeout(struct work_struct *work)

drivers/char/apm-emulation.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,7 @@ static __poll_t apm_poll(struct file *fp, poll_table * wait)
241241
struct apm_user *as = fp->private_data;
242242

243243
poll_wait(fp, &apm_waitqueue, wait);
244-
return queue_empty(&as->queue) ? 0 : POLLIN | POLLRDNORM;
244+
return queue_empty(&as->queue) ? 0 : EPOLLIN | EPOLLRDNORM;
245245
}
246246

247247
/*

drivers/char/dsp56k.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -414,7 +414,7 @@ static __poll_t dsp56k_poll(struct file *file, poll_table *wait)
414414
{
415415
case DSP56K_DEV_56001:
416416
/* poll_wait(file, ???, wait); */
417-
return POLLIN | POLLRDNORM | POLLOUT;
417+
return EPOLLIN | EPOLLRDNORM | EPOLLOUT;
418418

419419
default:
420420
printk("DSP56k driver: Unknown minor device: %d\n", dev);

drivers/char/dtlk.c

+3-3
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@
6262
#include <linux/uaccess.h> /* for get_user, etc. */
6363
#include <linux/wait.h> /* for wait_queue */
6464
#include <linux/init.h> /* for __init, module_{init,exit} */
65-
#include <linux/poll.h> /* for POLLIN, etc. */
65+
#include <linux/poll.h> /* for EPOLLIN, etc. */
6666
#include <linux/dtlk.h> /* local header file for DoubleTalk values */
6767

6868
#ifdef TRACING
@@ -244,11 +244,11 @@ static __poll_t dtlk_poll(struct file *file, poll_table * wait)
244244

245245
if (dtlk_has_indexing && dtlk_readable()) {
246246
del_timer(&dtlk_timer);
247-
mask = POLLIN | POLLRDNORM;
247+
mask = EPOLLIN | EPOLLRDNORM;
248248
}
249249
if (dtlk_writeable()) {
250250
del_timer(&dtlk_timer);
251-
mask |= POLLOUT | POLLWRNORM;
251+
mask |= EPOLLOUT | EPOLLWRNORM;
252252
}
253253
/* there are no exception conditions */
254254

drivers/char/hpet.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -359,7 +359,7 @@ static __poll_t hpet_poll(struct file *file, poll_table * wait)
359359
spin_unlock_irq(&hpet_lock);
360360

361361
if (v != 0)
362-
return POLLIN | POLLRDNORM;
362+
return EPOLLIN | EPOLLRDNORM;
363363

364364
return 0;
365365
}

drivers/char/ipmi/bt-bmc.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -349,10 +349,10 @@ static __poll_t bt_bmc_poll(struct file *file, poll_table *wait)
349349
ctrl = bt_inb(bt_bmc, BT_CTRL);
350350

351351
if (ctrl & BT_CTRL_H2B_ATN)
352-
mask |= POLLIN;
352+
mask |= EPOLLIN;
353353

354354
if (!(ctrl & (BT_CTRL_H_BUSY | BT_CTRL_B2H_ATN)))
355-
mask |= POLLOUT;
355+
mask |= EPOLLOUT;
356356

357357
return mask;
358358
}

drivers/char/ipmi/ipmi_devintf.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ static __poll_t ipmi_poll(struct file *file, poll_table *wait)
8989
spin_lock_irqsave(&priv->recv_msg_lock, flags);
9090

9191
if (!list_empty(&(priv->recv_msgs)))
92-
mask |= (POLLIN | POLLRDNORM);
92+
mask |= (EPOLLIN | EPOLLRDNORM);
9393

9494
spin_unlock_irqrestore(&priv->recv_msg_lock, flags);
9595

drivers/char/ipmi/ipmi_watchdog.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -895,7 +895,7 @@ static __poll_t ipmi_poll(struct file *file, poll_table *wait)
895895

896896
spin_lock(&ipmi_read_lock);
897897
if (data_to_read)
898-
mask |= (POLLIN | POLLRDNORM);
898+
mask |= (EPOLLIN | EPOLLRDNORM);
899899
spin_unlock(&ipmi_read_lock);
900900

901901
return mask;

drivers/char/pcmcia/cm4040_cs.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -423,9 +423,9 @@ static __poll_t cm4040_poll(struct file *filp, poll_table *wait)
423423
poll_wait(filp, &dev->poll_wait, wait);
424424

425425
if (test_and_clear_bit(BS_READABLE, &dev->buffer_status))
426-
mask |= POLLIN | POLLRDNORM;
426+
mask |= EPOLLIN | EPOLLRDNORM;
427427
if (test_and_clear_bit(BS_WRITABLE, &dev->buffer_status))
428-
mask |= POLLOUT | POLLWRNORM;
428+
mask |= EPOLLOUT | EPOLLWRNORM;
429429

430430
DEBUGP(2, dev, "<- cm4040_poll(%u)\n", mask);
431431

0 commit comments

Comments
 (0)