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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 4 additions & 4 deletions
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

Lines changed: 5 additions & 5 deletions
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 2 additions & 2 deletions
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 4 additions & 4 deletions
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

Lines changed: 5 additions & 5 deletions
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

Lines changed: 4 additions & 4 deletions
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

Lines changed: 1 addition & 1 deletion
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
}

0 commit comments

Comments
 (0)