mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2024-12-29 17:23:36 +00: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
@ -173,7 +173,7 @@ static __poll_t gpio_poll(struct file *file, poll_table *wait)
|
||||
|
||||
if ((data & priv->highalarm) ||
|
||||
(~data & priv->lowalarm)) {
|
||||
mask = POLLIN|POLLRDNORM;
|
||||
mask = EPOLLIN|EPOLLRDNORM;
|
||||
}
|
||||
|
||||
out:
|
||||
|
@ -666,16 +666,16 @@ static __poll_t sync_serial_poll(struct file *file, poll_table *wait)
|
||||
poll_wait(file, &port->in_wait_q, wait);
|
||||
/* Some room to write */
|
||||
if (port->out_count < OUT_BUFFER_SIZE)
|
||||
mask |= POLLOUT | POLLWRNORM;
|
||||
mask |= EPOLLOUT | EPOLLWRNORM;
|
||||
/* At least an inbufchunk of data */
|
||||
if (sync_data_avail(port) >= port->inbufchunk)
|
||||
mask |= POLLIN | POLLRDNORM;
|
||||
mask |= EPOLLIN | EPOLLRDNORM;
|
||||
|
||||
DEBUGPOLL(if (mask != prev_mask)
|
||||
printk(KERN_DEBUG "sync_serial_poll: mask 0x%08X %s %s\n",
|
||||
mask,
|
||||
mask & POLLOUT ? "POLLOUT" : "",
|
||||
mask & POLLIN ? "POLLIN" : "");
|
||||
mask & EPOLLOUT ? "POLLOUT" : "",
|
||||
mask & EPOLLIN ? "POLLIN" : "");
|
||||
prev_mask = mask;
|
||||
);
|
||||
return mask;
|
||||
|
@ -574,24 +574,24 @@ static __poll_t sync_serial_poll(struct file *file, poll_table *wait)
|
||||
|
||||
/* No active transfer, descriptors are available */
|
||||
if (port->output && !port->tr_running)
|
||||
mask |= POLLOUT | POLLWRNORM;
|
||||
mask |= EPOLLOUT | EPOLLWRNORM;
|
||||
|
||||
/* Descriptor and buffer space available. */
|
||||
if (port->output &&
|
||||
port->active_tr_descr != port->catch_tr_descr &&
|
||||
port->out_buf_count < OUT_BUFFER_SIZE)
|
||||
mask |= POLLOUT | POLLWRNORM;
|
||||
mask |= EPOLLOUT | EPOLLWRNORM;
|
||||
|
||||
/* At least an inbufchunk of data */
|
||||
if (port->input && sync_data_avail(port) >= port->inbufchunk)
|
||||
mask |= POLLIN | POLLRDNORM;
|
||||
mask |= EPOLLIN | EPOLLRDNORM;
|
||||
|
||||
DEBUGPOLL(
|
||||
if (mask != prev_mask)
|
||||
pr_info("sync_serial_poll: mask 0x%08X %s %s\n",
|
||||
mask,
|
||||
mask & POLLOUT ? "POLLOUT" : "",
|
||||
mask & POLLIN ? "POLLIN" : "");
|
||||
mask & EPOLLOUT ? "POLLOUT" : "",
|
||||
mask & EPOLLIN ? "POLLIN" : "");
|
||||
prev_mask = mask;
|
||||
);
|
||||
return mask;
|
||||
|
@ -1670,7 +1670,7 @@ pfm_poll(struct file *filp, poll_table * wait)
|
||||
PROTECT_CTX(ctx, flags);
|
||||
|
||||
if (PFM_CTXQ_EMPTY(ctx) == 0)
|
||||
mask = POLLIN | POLLRDNORM;
|
||||
mask = EPOLLIN | EPOLLRDNORM;
|
||||
|
||||
UNPROTECT_CTX(ctx, flags);
|
||||
|
||||
|
@ -349,11 +349,11 @@ static __poll_t file_poll(struct file *file, poll_table *wait)
|
||||
|
||||
/* data available to read? */
|
||||
if (rtlx_read_poll(minor, 0))
|
||||
mask |= POLLIN | POLLRDNORM;
|
||||
mask |= EPOLLIN | EPOLLRDNORM;
|
||||
|
||||
/* space to write */
|
||||
if (rtlx_write_poll(minor))
|
||||
mask |= POLLOUT | POLLWRNORM;
|
||||
mask |= EPOLLOUT | EPOLLWRNORM;
|
||||
|
||||
return mask;
|
||||
}
|
||||
|
@ -392,7 +392,7 @@ static __poll_t rtas_log_poll(struct file *file, poll_table * wait)
|
||||
{
|
||||
poll_wait(file, &rtas_log_wait, wait);
|
||||
if (rtas_log_size)
|
||||
return POLLIN | POLLRDNORM;
|
||||
return EPOLLIN | EPOLLRDNORM;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -101,9 +101,9 @@ static __poll_t spu_backing_mbox_stat_poll(struct spu_context *ctx,
|
||||
but first mark any pending interrupts as done so
|
||||
we don't get woken up unnecessarily */
|
||||
|
||||
if (events & (POLLIN | POLLRDNORM)) {
|
||||
if (events & (EPOLLIN | EPOLLRDNORM)) {
|
||||
if (stat & 0xff0000)
|
||||
ret |= POLLIN | POLLRDNORM;
|
||||
ret |= EPOLLIN | EPOLLRDNORM;
|
||||
else {
|
||||
ctx->csa.priv1.int_stat_class2_RW &=
|
||||
~CLASS2_MAILBOX_INTR;
|
||||
@ -111,9 +111,9 @@ static __poll_t spu_backing_mbox_stat_poll(struct spu_context *ctx,
|
||||
CLASS2_ENABLE_MAILBOX_INTR;
|
||||
}
|
||||
}
|
||||
if (events & (POLLOUT | POLLWRNORM)) {
|
||||
if (events & (EPOLLOUT | EPOLLWRNORM)) {
|
||||
if (stat & 0x00ff00)
|
||||
ret = POLLOUT | POLLWRNORM;
|
||||
ret = EPOLLOUT | EPOLLWRNORM;
|
||||
else {
|
||||
ctx->csa.priv1.int_stat_class2_RW &=
|
||||
~CLASS2_MAILBOX_THRESHOLD_INTR;
|
||||
|
@ -774,7 +774,7 @@ static __poll_t spufs_ibox_poll(struct file *file, poll_table *wait)
|
||||
* that poll should not sleep. Will be fixed later.
|
||||
*/
|
||||
mutex_lock(&ctx->state_mutex);
|
||||
mask = ctx->ops->mbox_stat_poll(ctx, POLLIN | POLLRDNORM);
|
||||
mask = ctx->ops->mbox_stat_poll(ctx, EPOLLIN | EPOLLRDNORM);
|
||||
spu_release(ctx);
|
||||
|
||||
return mask;
|
||||
@ -910,7 +910,7 @@ static __poll_t spufs_wbox_poll(struct file *file, poll_table *wait)
|
||||
* that poll should not sleep. Will be fixed later.
|
||||
*/
|
||||
mutex_lock(&ctx->state_mutex);
|
||||
mask = ctx->ops->mbox_stat_poll(ctx, POLLOUT | POLLWRNORM);
|
||||
mask = ctx->ops->mbox_stat_poll(ctx, EPOLLOUT | EPOLLWRNORM);
|
||||
spu_release(ctx);
|
||||
|
||||
return mask;
|
||||
@ -1710,9 +1710,9 @@ static __poll_t spufs_mfc_poll(struct file *file,poll_table *wait)
|
||||
|
||||
mask = 0;
|
||||
if (free_elements & 0xffff)
|
||||
mask |= POLLOUT | POLLWRNORM;
|
||||
mask |= EPOLLOUT | EPOLLWRNORM;
|
||||
if (tagstatus & ctx->tagwait)
|
||||
mask |= POLLIN | POLLRDNORM;
|
||||
mask |= EPOLLIN | EPOLLRDNORM;
|
||||
|
||||
pr_debug("%s: free %d tagstatus %d tagwait %d\n", __func__,
|
||||
free_elements, tagstatus, ctx->tagwait);
|
||||
@ -2469,7 +2469,7 @@ static __poll_t spufs_switch_log_poll(struct file *file, poll_table *wait)
|
||||
return rc;
|
||||
|
||||
if (spufs_switch_log_used(ctx) > 0)
|
||||
mask |= POLLIN;
|
||||
mask |= EPOLLIN;
|
||||
|
||||
spu_release(ctx);
|
||||
|
||||
|
@ -70,17 +70,17 @@ static __poll_t spu_hw_mbox_stat_poll(struct spu_context *ctx, __poll_t events)
|
||||
but first mark any pending interrupts as done so
|
||||
we don't get woken up unnecessarily */
|
||||
|
||||
if (events & (POLLIN | POLLRDNORM)) {
|
||||
if (events & (EPOLLIN | EPOLLRDNORM)) {
|
||||
if (stat & 0xff0000)
|
||||
ret |= POLLIN | POLLRDNORM;
|
||||
ret |= EPOLLIN | EPOLLRDNORM;
|
||||
else {
|
||||
spu_int_stat_clear(spu, 2, CLASS2_MAILBOX_INTR);
|
||||
spu_int_mask_or(spu, 2, CLASS2_ENABLE_MAILBOX_INTR);
|
||||
}
|
||||
}
|
||||
if (events & (POLLOUT | POLLWRNORM)) {
|
||||
if (events & (EPOLLOUT | EPOLLWRNORM)) {
|
||||
if (stat & 0x00ff00)
|
||||
ret = POLLOUT | POLLWRNORM;
|
||||
ret = EPOLLOUT | EPOLLWRNORM;
|
||||
else {
|
||||
spu_int_stat_clear(spu, 2,
|
||||
CLASS2_MAILBOX_THRESHOLD_INTR);
|
||||
|
@ -153,7 +153,7 @@ static __poll_t opal_prd_poll(struct file *file,
|
||||
poll_wait(file, &opal_prd_msg_wait, wait);
|
||||
|
||||
if (!opal_msg_queue_empty())
|
||||
return POLLIN | POLLRDNORM;
|
||||
return EPOLLIN | EPOLLRDNORM;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
@ -1515,7 +1515,7 @@ static __poll_t do_poll(struct file *fp, poll_table *wait)
|
||||
return 0;
|
||||
poll_wait(fp, &apm_waitqueue, wait);
|
||||
if (!queue_empty(as))
|
||||
return POLLIN | POLLRDNORM;
|
||||
return EPOLLIN | EPOLLRDNORM;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -247,9 +247,9 @@ static __poll_t mce_chrdev_poll(struct file *file, poll_table *wait)
|
||||
{
|
||||
poll_wait(file, &mce_chrdev_wait, wait);
|
||||
if (READ_ONCE(mcelog.next))
|
||||
return POLLIN | POLLRDNORM;
|
||||
return EPOLLIN | EPOLLRDNORM;
|
||||
if (!mce_apei_read_done && apei_check_mce())
|
||||
return POLLIN | POLLRDNORM;
|
||||
return EPOLLIN | EPOLLRDNORM;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -849,9 +849,9 @@ static __poll_t bsg_poll(struct file *file, poll_table *wait)
|
||||
|
||||
spin_lock_irq(&bd->lock);
|
||||
if (!list_empty(&bd->done_list))
|
||||
mask |= POLLIN | POLLRDNORM;
|
||||
mask |= EPOLLIN | EPOLLRDNORM;
|
||||
if (bd->queued_cmds < bd->max_queue)
|
||||
mask |= POLLOUT;
|
||||
mask |= EPOLLOUT;
|
||||
spin_unlock_irq(&bd->lock);
|
||||
|
||||
return mask;
|
||||
|
@ -735,9 +735,9 @@ void af_alg_wmem_wakeup(struct sock *sk)
|
||||
rcu_read_lock();
|
||||
wq = rcu_dereference(sk->sk_wq);
|
||||
if (skwq_has_sleeper(wq))
|
||||
wake_up_interruptible_sync_poll(&wq->wait, POLLIN |
|
||||
POLLRDNORM |
|
||||
POLLRDBAND);
|
||||
wake_up_interruptible_sync_poll(&wq->wait, EPOLLIN |
|
||||
EPOLLRDNORM |
|
||||
EPOLLRDBAND);
|
||||
sk_wake_async(sk, SOCK_WAKE_WAITD, POLL_IN);
|
||||
rcu_read_unlock();
|
||||
}
|
||||
@ -800,9 +800,9 @@ void af_alg_data_wakeup(struct sock *sk)
|
||||
rcu_read_lock();
|
||||
wq = rcu_dereference(sk->sk_wq);
|
||||
if (skwq_has_sleeper(wq))
|
||||
wake_up_interruptible_sync_poll(&wq->wait, POLLOUT |
|
||||
POLLRDNORM |
|
||||
POLLRDBAND);
|
||||
wake_up_interruptible_sync_poll(&wq->wait, EPOLLOUT |
|
||||
EPOLLRDNORM |
|
||||
EPOLLRDBAND);
|
||||
sk_wake_async(sk, SOCK_WAKE_SPACE, POLL_OUT);
|
||||
rcu_read_unlock();
|
||||
}
|
||||
@ -1076,10 +1076,10 @@ __poll_t af_alg_poll(struct file *file, struct socket *sock,
|
||||
mask = 0;
|
||||
|
||||
if (!ctx->more || ctx->used)
|
||||
mask |= POLLIN | POLLRDNORM;
|
||||
mask |= EPOLLIN | EPOLLRDNORM;
|
||||
|
||||
if (af_alg_writable(sk))
|
||||
mask |= POLLOUT | POLLWRNORM | POLLWRBAND;
|
||||
mask |= EPOLLOUT | EPOLLWRNORM | EPOLLWRBAND;
|
||||
|
||||
return mask;
|
||||
}
|
||||
|
@ -724,9 +724,9 @@ static __poll_t acpi_aml_poll(struct file *file, poll_table *wait)
|
||||
|
||||
poll_wait(file, &acpi_aml_io.wait, wait);
|
||||
if (acpi_aml_user_readable())
|
||||
masks |= POLLIN | POLLRDNORM;
|
||||
masks |= EPOLLIN | EPOLLRDNORM;
|
||||
if (acpi_aml_user_writable())
|
||||
masks |= POLLOUT | POLLWRNORM;
|
||||
masks |= EPOLLOUT | EPOLLWRNORM;
|
||||
|
||||
return masks;
|
||||
}
|
||||
|
@ -4371,7 +4371,7 @@ static int binder_thread_release(struct binder_proc *proc,
|
||||
*/
|
||||
if ((thread->looper & BINDER_LOOPER_STATE_POLL) &&
|
||||
waitqueue_active(&thread->wait)) {
|
||||
wake_up_poll(&thread->wait, POLLHUP | POLLFREE);
|
||||
wake_up_poll(&thread->wait, EPOLLHUP | POLLFREE);
|
||||
}
|
||||
|
||||
binder_inner_proc_unlock(thread->proc);
|
||||
@ -4401,7 +4401,7 @@ static __poll_t binder_poll(struct file *filp,
|
||||
poll_wait(filp, &thread->wait, wait);
|
||||
|
||||
if (binder_has_work(thread, wait_for_proc_work))
|
||||
return POLLIN;
|
||||
return EPOLLIN;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
@ -306,9 +306,9 @@ static __poll_t vhci_poll(struct file *file, poll_table *wait)
|
||||
poll_wait(file, &data->read_wait, wait);
|
||||
|
||||
if (!skb_queue_empty(&data->readq))
|
||||
return POLLIN | POLLRDNORM;
|
||||
return EPOLLIN | EPOLLRDNORM;
|
||||
|
||||
return POLLOUT | POLLWRNORM;
|
||||
return EPOLLOUT | EPOLLWRNORM;
|
||||
}
|
||||
|
||||
static void vhci_open_timeout(struct work_struct *work)
|
||||
|
@ -241,7 +241,7 @@ static __poll_t apm_poll(struct file *fp, poll_table * wait)
|
||||
struct apm_user *as = fp->private_data;
|
||||
|
||||
poll_wait(fp, &apm_waitqueue, wait);
|
||||
return queue_empty(&as->queue) ? 0 : POLLIN | POLLRDNORM;
|
||||
return queue_empty(&as->queue) ? 0 : EPOLLIN | EPOLLRDNORM;
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -414,7 +414,7 @@ static __poll_t dsp56k_poll(struct file *file, poll_table *wait)
|
||||
{
|
||||
case DSP56K_DEV_56001:
|
||||
/* poll_wait(file, ???, wait); */
|
||||
return POLLIN | POLLRDNORM | POLLOUT;
|
||||
return EPOLLIN | EPOLLRDNORM | EPOLLOUT;
|
||||
|
||||
default:
|
||||
printk("DSP56k driver: Unknown minor device: %d\n", dev);
|
||||
|
@ -62,7 +62,7 @@
|
||||
#include <linux/uaccess.h> /* for get_user, etc. */
|
||||
#include <linux/wait.h> /* for wait_queue */
|
||||
#include <linux/init.h> /* for __init, module_{init,exit} */
|
||||
#include <linux/poll.h> /* for POLLIN, etc. */
|
||||
#include <linux/poll.h> /* for EPOLLIN, etc. */
|
||||
#include <linux/dtlk.h> /* local header file for DoubleTalk values */
|
||||
|
||||
#ifdef TRACING
|
||||
@ -244,11 +244,11 @@ static __poll_t dtlk_poll(struct file *file, poll_table * wait)
|
||||
|
||||
if (dtlk_has_indexing && dtlk_readable()) {
|
||||
del_timer(&dtlk_timer);
|
||||
mask = POLLIN | POLLRDNORM;
|
||||
mask = EPOLLIN | EPOLLRDNORM;
|
||||
}
|
||||
if (dtlk_writeable()) {
|
||||
del_timer(&dtlk_timer);
|
||||
mask |= POLLOUT | POLLWRNORM;
|
||||
mask |= EPOLLOUT | EPOLLWRNORM;
|
||||
}
|
||||
/* there are no exception conditions */
|
||||
|
||||
|
@ -359,7 +359,7 @@ static __poll_t hpet_poll(struct file *file, poll_table * wait)
|
||||
spin_unlock_irq(&hpet_lock);
|
||||
|
||||
if (v != 0)
|
||||
return POLLIN | POLLRDNORM;
|
||||
return EPOLLIN | EPOLLRDNORM;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
@ -349,10 +349,10 @@ static __poll_t bt_bmc_poll(struct file *file, poll_table *wait)
|
||||
ctrl = bt_inb(bt_bmc, BT_CTRL);
|
||||
|
||||
if (ctrl & BT_CTRL_H2B_ATN)
|
||||
mask |= POLLIN;
|
||||
mask |= EPOLLIN;
|
||||
|
||||
if (!(ctrl & (BT_CTRL_H_BUSY | BT_CTRL_B2H_ATN)))
|
||||
mask |= POLLOUT;
|
||||
mask |= EPOLLOUT;
|
||||
|
||||
return mask;
|
||||
}
|
||||
|
@ -89,7 +89,7 @@ static __poll_t ipmi_poll(struct file *file, poll_table *wait)
|
||||
spin_lock_irqsave(&priv->recv_msg_lock, flags);
|
||||
|
||||
if (!list_empty(&(priv->recv_msgs)))
|
||||
mask |= (POLLIN | POLLRDNORM);
|
||||
mask |= (EPOLLIN | EPOLLRDNORM);
|
||||
|
||||
spin_unlock_irqrestore(&priv->recv_msg_lock, flags);
|
||||
|
||||
|
@ -895,7 +895,7 @@ static __poll_t ipmi_poll(struct file *file, poll_table *wait)
|
||||
|
||||
spin_lock(&ipmi_read_lock);
|
||||
if (data_to_read)
|
||||
mask |= (POLLIN | POLLRDNORM);
|
||||
mask |= (EPOLLIN | EPOLLRDNORM);
|
||||
spin_unlock(&ipmi_read_lock);
|
||||
|
||||
return mask;
|
||||
|
@ -423,9 +423,9 @@ static __poll_t cm4040_poll(struct file *filp, poll_table *wait)
|
||||
poll_wait(filp, &dev->poll_wait, wait);
|
||||
|
||||
if (test_and_clear_bit(BS_READABLE, &dev->buffer_status))
|
||||
mask |= POLLIN | POLLRDNORM;
|
||||
mask |= EPOLLIN | EPOLLRDNORM;
|
||||
if (test_and_clear_bit(BS_WRITABLE, &dev->buffer_status))
|
||||
mask |= POLLOUT | POLLWRNORM;
|
||||
mask |= EPOLLOUT | EPOLLWRNORM;
|
||||
|
||||
DEBUGP(2, dev, "<- cm4040_poll(%u)\n", mask);
|
||||
|
||||
|
@ -776,7 +776,7 @@ static __poll_t pp_poll(struct file *file, poll_table *wait)
|
||||
|
||||
poll_wait(file, &pp->irq_wait, wait);
|
||||
if (atomic_read(&pp->irqc))
|
||||
mask |= POLLIN | POLLRDNORM;
|
||||
mask |= EPOLLIN | EPOLLRDNORM;
|
||||
|
||||
return mask;
|
||||
}
|
||||
|
@ -1793,9 +1793,9 @@ random_poll(struct file *file, poll_table * wait)
|
||||
poll_wait(file, &random_write_wait, wait);
|
||||
mask = 0;
|
||||
if (ENTROPY_BITS(&input_pool) >= random_read_wakeup_bits)
|
||||
mask |= POLLIN | POLLRDNORM;
|
||||
mask |= EPOLLIN | EPOLLRDNORM;
|
||||
if (ENTROPY_BITS(&input_pool) < random_write_wakeup_bits)
|
||||
mask |= POLLOUT | POLLWRNORM;
|
||||
mask |= EPOLLOUT | EPOLLWRNORM;
|
||||
return mask;
|
||||
}
|
||||
|
||||
|
@ -804,7 +804,7 @@ static __poll_t rtc_poll(struct file *file, poll_table *wait)
|
||||
spin_unlock_irq(&rtc_lock);
|
||||
|
||||
if (l != 0)
|
||||
return POLLIN | POLLRDNORM;
|
||||
return EPOLLIN | EPOLLRDNORM;
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
@ -340,10 +340,10 @@ scdrv_poll(struct file *file, struct poll_table_struct *wait)
|
||||
|
||||
if (status > 0) {
|
||||
if (status & SAL_IROUTER_INTR_RECV) {
|
||||
mask |= POLLIN | POLLRDNORM;
|
||||
mask |= EPOLLIN | EPOLLRDNORM;
|
||||
}
|
||||
if (status & SAL_IROUTER_INTR_XMIT) {
|
||||
mask |= POLLOUT | POLLWRNORM;
|
||||
mask |= EPOLLOUT | EPOLLWRNORM;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -944,7 +944,7 @@ static __poll_t sonypi_misc_poll(struct file *file, poll_table *wait)
|
||||
{
|
||||
poll_wait(file, &sonypi_device.fifo_proc_list, wait);
|
||||
if (kfifo_len(&sonypi_device.fifo))
|
||||
return POLLIN | POLLRDNORM;
|
||||
return EPOLLIN | EPOLLRDNORM;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -180,15 +180,15 @@ static __poll_t vtpm_proxy_fops_poll(struct file *filp, poll_table *wait)
|
||||
|
||||
poll_wait(filp, &proxy_dev->wq, wait);
|
||||
|
||||
ret = POLLOUT;
|
||||
ret = EPOLLOUT;
|
||||
|
||||
mutex_lock(&proxy_dev->buf_lock);
|
||||
|
||||
if (proxy_dev->req_len)
|
||||
ret |= POLLIN | POLLRDNORM;
|
||||
ret |= EPOLLIN | EPOLLRDNORM;
|
||||
|
||||
if (!(proxy_dev->state & STATE_OPENED_FLAG))
|
||||
ret |= POLLHUP;
|
||||
ret |= EPOLLHUP;
|
||||
|
||||
mutex_unlock(&proxy_dev->buf_lock);
|
||||
|
||||
|
@ -992,15 +992,15 @@ static __poll_t port_fops_poll(struct file *filp, poll_table *wait)
|
||||
|
||||
if (!port->guest_connected) {
|
||||
/* Port got unplugged */
|
||||
return POLLHUP;
|
||||
return EPOLLHUP;
|
||||
}
|
||||
ret = 0;
|
||||
if (!will_read_block(port))
|
||||
ret |= POLLIN | POLLRDNORM;
|
||||
ret |= EPOLLIN | EPOLLRDNORM;
|
||||
if (!will_write_block(port))
|
||||
ret |= POLLOUT;
|
||||
ret |= EPOLLOUT;
|
||||
if (!port->host_connected)
|
||||
ret |= POLLHUP;
|
||||
ret |= EPOLLHUP;
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
@ -1758,15 +1758,15 @@ static __poll_t xillybus_poll(struct file *filp, poll_table *wait)
|
||||
|
||||
spin_lock_irqsave(&channel->wr_spinlock, flags);
|
||||
if (!channel->wr_empty || channel->wr_ready)
|
||||
mask |= POLLIN | POLLRDNORM;
|
||||
mask |= EPOLLIN | EPOLLRDNORM;
|
||||
|
||||
if (channel->wr_hangup)
|
||||
/*
|
||||
* Not POLLHUP, because its behavior is in the
|
||||
* mist, and POLLIN does what we want: Wake up
|
||||
* Not EPOLLHUP, because its behavior is in the
|
||||
* mist, and EPOLLIN does what we want: Wake up
|
||||
* the read file descriptor so it sees EOF.
|
||||
*/
|
||||
mask |= POLLIN | POLLRDNORM;
|
||||
mask |= EPOLLIN | EPOLLRDNORM;
|
||||
spin_unlock_irqrestore(&channel->wr_spinlock, flags);
|
||||
}
|
||||
|
||||
@ -1781,12 +1781,12 @@ static __poll_t xillybus_poll(struct file *filp, poll_table *wait)
|
||||
|
||||
spin_lock_irqsave(&channel->rd_spinlock, flags);
|
||||
if (!channel->rd_full)
|
||||
mask |= POLLOUT | POLLWRNORM;
|
||||
mask |= EPOLLOUT | EPOLLWRNORM;
|
||||
spin_unlock_irqrestore(&channel->rd_spinlock, flags);
|
||||
}
|
||||
|
||||
if (channel->endpoint->fatal_error)
|
||||
mask |= POLLERR;
|
||||
mask |= EPOLLERR;
|
||||
|
||||
return mask;
|
||||
}
|
||||
|
@ -135,10 +135,10 @@ static loff_t dma_buf_llseek(struct file *file, loff_t offset, int whence)
|
||||
* Userspace can query the state of these implicitly tracked fences using poll()
|
||||
* and related system calls:
|
||||
*
|
||||
* - Checking for POLLIN, i.e. read access, can be use to query the state of the
|
||||
* - Checking for EPOLLIN, i.e. read access, can be use to query the state of the
|
||||
* most recent write or exclusive fence.
|
||||
*
|
||||
* - Checking for POLLOUT, i.e. write access, can be used to query the state of
|
||||
* - Checking for EPOLLOUT, i.e. write access, can be used to query the state of
|
||||
* all attached fences, shared and exclusive ones.
|
||||
*
|
||||
* Note that this only signals the completion of the respective fences, i.e. the
|
||||
@ -168,13 +168,13 @@ static __poll_t dma_buf_poll(struct file *file, poll_table *poll)
|
||||
|
||||
dmabuf = file->private_data;
|
||||
if (!dmabuf || !dmabuf->resv)
|
||||
return POLLERR;
|
||||
return EPOLLERR;
|
||||
|
||||
resv = dmabuf->resv;
|
||||
|
||||
poll_wait(file, &dmabuf->poll, poll);
|
||||
|
||||
events = poll_requested_events(poll) & (POLLIN | POLLOUT);
|
||||
events = poll_requested_events(poll) & (EPOLLIN | EPOLLOUT);
|
||||
if (!events)
|
||||
return 0;
|
||||
|
||||
@ -193,12 +193,12 @@ static __poll_t dma_buf_poll(struct file *file, poll_table *poll)
|
||||
goto retry;
|
||||
}
|
||||
|
||||
if (fence_excl && (!(events & POLLOUT) || shared_count == 0)) {
|
||||
if (fence_excl && (!(events & EPOLLOUT) || shared_count == 0)) {
|
||||
struct dma_buf_poll_cb_t *dcb = &dmabuf->cb_excl;
|
||||
__poll_t pevents = POLLIN;
|
||||
__poll_t pevents = EPOLLIN;
|
||||
|
||||
if (shared_count == 0)
|
||||
pevents |= POLLOUT;
|
||||
pevents |= EPOLLOUT;
|
||||
|
||||
spin_lock_irq(&dmabuf->poll.lock);
|
||||
if (dcb->active) {
|
||||
@ -228,19 +228,19 @@ static __poll_t dma_buf_poll(struct file *file, poll_table *poll)
|
||||
}
|
||||
}
|
||||
|
||||
if ((events & POLLOUT) && shared_count > 0) {
|
||||
if ((events & EPOLLOUT) && shared_count > 0) {
|
||||
struct dma_buf_poll_cb_t *dcb = &dmabuf->cb_shared;
|
||||
int i;
|
||||
|
||||
/* Only queue a new callback if no event has fired yet */
|
||||
spin_lock_irq(&dmabuf->poll.lock);
|
||||
if (dcb->active)
|
||||
events &= ~POLLOUT;
|
||||
events &= ~EPOLLOUT;
|
||||
else
|
||||
dcb->active = POLLOUT;
|
||||
dcb->active = EPOLLOUT;
|
||||
spin_unlock_irq(&dmabuf->poll.lock);
|
||||
|
||||
if (!(events & POLLOUT))
|
||||
if (!(events & EPOLLOUT))
|
||||
goto out;
|
||||
|
||||
for (i = 0; i < shared_count; ++i) {
|
||||
@ -253,14 +253,14 @@ static __poll_t dma_buf_poll(struct file *file, poll_table *poll)
|
||||
*
|
||||
* call dma_buf_poll_cb and force a recheck!
|
||||
*/
|
||||
events &= ~POLLOUT;
|
||||
events &= ~EPOLLOUT;
|
||||
dma_buf_poll_cb(NULL, &dcb->cb);
|
||||
break;
|
||||
}
|
||||
if (!dma_fence_add_callback(fence, &dcb->cb,
|
||||
dma_buf_poll_cb)) {
|
||||
dma_fence_put(fence);
|
||||
events &= ~POLLOUT;
|
||||
events &= ~EPOLLOUT;
|
||||
break;
|
||||
}
|
||||
dma_fence_put(fence);
|
||||
|
@ -325,7 +325,7 @@ static __poll_t sync_file_poll(struct file *file, poll_table *wait)
|
||||
wake_up_all(&sync_file->wq);
|
||||
}
|
||||
|
||||
return dma_fence_is_signaled(sync_file->fence) ? POLLIN : 0;
|
||||
return dma_fence_is_signaled(sync_file->fence) ? EPOLLIN : 0;
|
||||
}
|
||||
|
||||
static long sync_file_ioctl_merge(struct sync_file *sync_file,
|
||||
|
@ -1792,9 +1792,9 @@ static __poll_t fw_device_op_poll(struct file *file, poll_table * pt)
|
||||
poll_wait(file, &client->wait, pt);
|
||||
|
||||
if (fw_device_is_shutdown(client->device))
|
||||
mask |= POLLHUP | POLLERR;
|
||||
mask |= EPOLLHUP | EPOLLERR;
|
||||
if (!list_empty(&client->event_list))
|
||||
mask |= POLLIN | POLLRDNORM;
|
||||
mask |= EPOLLIN | EPOLLRDNORM;
|
||||
|
||||
return mask;
|
||||
}
|
||||
|
@ -337,10 +337,10 @@ nosy_poll(struct file *file, poll_table *pt)
|
||||
poll_wait(file, &client->buffer.wait, pt);
|
||||
|
||||
if (atomic_read(&client->buffer.size) > 0)
|
||||
ret = POLLIN | POLLRDNORM;
|
||||
ret = EPOLLIN | EPOLLRDNORM;
|
||||
|
||||
if (list_empty(&client->lynx->link))
|
||||
ret |= POLLHUP;
|
||||
ret |= EPOLLHUP;
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
@ -630,7 +630,7 @@ static __poll_t lineevent_poll(struct file *filep,
|
||||
poll_wait(filep, &le->wait, wait);
|
||||
|
||||
if (!kfifo_is_empty(&le->events))
|
||||
events = POLLIN | POLLRDNORM;
|
||||
events = EPOLLIN | EPOLLRDNORM;
|
||||
|
||||
return events;
|
||||
}
|
||||
@ -775,7 +775,7 @@ static irqreturn_t lineevent_irq_thread(int irq, void *p)
|
||||
|
||||
ret = kfifo_put(&le->events, ge);
|
||||
if (ret != 0)
|
||||
wake_up_poll(&le->wait, POLLIN);
|
||||
wake_up_poll(&le->wait, EPOLLIN);
|
||||
|
||||
return IRQ_HANDLED;
|
||||
}
|
||||
|
@ -567,7 +567,7 @@ __poll_t drm_poll(struct file *filp, struct poll_table_struct *wait)
|
||||
poll_wait(filp, &file_priv->event_wait, wait);
|
||||
|
||||
if (!list_empty(&file_priv->event_list))
|
||||
mask |= POLLIN | POLLRDNORM;
|
||||
mask |= EPOLLIN | EPOLLRDNORM;
|
||||
|
||||
return mask;
|
||||
}
|
||||
|
@ -244,7 +244,7 @@
|
||||
* The two separate pointers let us decouple read()s from tail pointer aging.
|
||||
*
|
||||
* The tail pointers are checked and updated at a limited rate within a hrtimer
|
||||
* callback (the same callback that is used for delivering POLLIN events)
|
||||
* callback (the same callback that is used for delivering EPOLLIN events)
|
||||
*
|
||||
* Initially the tails are marked invalid with %INVALID_TAIL_PTR which
|
||||
* indicates that an updated tail pointer is needed.
|
||||
@ -2292,13 +2292,13 @@ static ssize_t i915_perf_read(struct file *file,
|
||||
mutex_unlock(&dev_priv->perf.lock);
|
||||
}
|
||||
|
||||
/* We allow the poll checking to sometimes report false positive POLLIN
|
||||
/* We allow the poll checking to sometimes report false positive EPOLLIN
|
||||
* events where we might actually report EAGAIN on read() if there's
|
||||
* not really any data available. In this situation though we don't
|
||||
* want to enter a busy loop between poll() reporting a POLLIN event
|
||||
* want to enter a busy loop between poll() reporting a EPOLLIN event
|
||||
* and read() returning -EAGAIN. Clearing the oa.pollin state here
|
||||
* effectively ensures we back off until the next hrtimer callback
|
||||
* before reporting another POLLIN event.
|
||||
* before reporting another EPOLLIN event.
|
||||
*/
|
||||
if (ret >= 0 || ret == -EAGAIN) {
|
||||
/* Maybe make ->pollin per-stream state if we support multiple
|
||||
@ -2358,7 +2358,7 @@ static __poll_t i915_perf_poll_locked(struct drm_i915_private *dev_priv,
|
||||
* samples to read.
|
||||
*/
|
||||
if (dev_priv->perf.oa.pollin)
|
||||
events |= POLLIN;
|
||||
events |= EPOLLIN;
|
||||
|
||||
return events;
|
||||
}
|
||||
|
@ -1271,7 +1271,7 @@ static __poll_t vga_arb_fpoll(struct file *file, poll_table *wait)
|
||||
pr_debug("%s\n", __func__);
|
||||
|
||||
poll_wait(file, &vga_wait_queue, wait);
|
||||
return POLLIN;
|
||||
return EPOLLIN;
|
||||
}
|
||||
|
||||
static int vga_arb_open(struct inode *inode, struct file *file)
|
||||
|
@ -1185,9 +1185,9 @@ static __poll_t hid_debug_events_poll(struct file *file, poll_table *wait)
|
||||
|
||||
poll_wait(file, &list->hdev->debug_wait, wait);
|
||||
if (list->head != list->tail)
|
||||
return POLLIN | POLLRDNORM;
|
||||
return EPOLLIN | EPOLLRDNORM;
|
||||
if (!list->hdev->debug)
|
||||
return POLLERR | POLLHUP;
|
||||
return EPOLLERR | EPOLLHUP;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -142,9 +142,9 @@ static __poll_t roccat_poll(struct file *file, poll_table *wait)
|
||||
struct roccat_reader *reader = file->private_data;
|
||||
poll_wait(file, &reader->device->wait, wait);
|
||||
if (reader->cbuf_start != reader->device->cbuf_end)
|
||||
return POLLIN | POLLRDNORM;
|
||||
return EPOLLIN | EPOLLRDNORM;
|
||||
if (!reader->device->exist)
|
||||
return POLLERR | POLLHUP;
|
||||
return EPOLLERR | EPOLLHUP;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -714,7 +714,7 @@ static __poll_t hid_sensor_custom_poll(struct file *file,
|
||||
poll_wait(file, &sensor_inst->wait, wait);
|
||||
|
||||
if (!kfifo_is_empty(&sensor_inst->data_fifo))
|
||||
mask = POLLIN | POLLRDNORM;
|
||||
mask = EPOLLIN | EPOLLRDNORM;
|
||||
|
||||
return mask;
|
||||
}
|
||||
|
@ -255,9 +255,9 @@ static __poll_t hidraw_poll(struct file *file, poll_table *wait)
|
||||
|
||||
poll_wait(file, &list->hidraw->wait, wait);
|
||||
if (list->head != list->tail)
|
||||
return POLLIN | POLLRDNORM;
|
||||
return EPOLLIN | EPOLLRDNORM;
|
||||
if (!list->hidraw->exist)
|
||||
return POLLERR | POLLHUP;
|
||||
return EPOLLERR | EPOLLHUP;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -760,7 +760,7 @@ static __poll_t uhid_char_poll(struct file *file, poll_table *wait)
|
||||
poll_wait(file, &uhid->waitq, wait);
|
||||
|
||||
if (uhid->head != uhid->tail)
|
||||
return POLLIN | POLLRDNORM;
|
||||
return EPOLLIN | EPOLLRDNORM;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
@ -428,9 +428,9 @@ static __poll_t hiddev_poll(struct file *file, poll_table *wait)
|
||||
|
||||
poll_wait(file, &list->hiddev->wait, wait);
|
||||
if (list->head != list->tail)
|
||||
return POLLIN | POLLRDNORM;
|
||||
return EPOLLIN | EPOLLRDNORM;
|
||||
if (!list->hiddev->exist)
|
||||
return POLLERR | POLLHUP;
|
||||
return EPOLLERR | EPOLLHUP;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -1132,9 +1132,9 @@ static __poll_t cs_char_poll(struct file *file, poll_table *wait)
|
||||
poll_wait(file, &cs_char_data.wait, wait);
|
||||
spin_lock_bh(&csdata->lock);
|
||||
if (!list_empty(&csdata->chardev_queue))
|
||||
ret = POLLIN | POLLRDNORM;
|
||||
ret = EPOLLIN | EPOLLRDNORM;
|
||||
else if (!list_empty(&csdata->dataind_queue))
|
||||
ret = POLLIN | POLLRDNORM;
|
||||
ret = EPOLLIN | EPOLLRDNORM;
|
||||
spin_unlock_bh(&csdata->lock);
|
||||
|
||||
return ret;
|
||||
|
@ -113,10 +113,10 @@ static __poll_t hvt_op_poll(struct file *file, poll_table *wait)
|
||||
poll_wait(file, &hvt->outmsg_q, wait);
|
||||
|
||||
if (hvt->mode == HVUTIL_TRANSPORT_DESTROY)
|
||||
return POLLERR | POLLHUP;
|
||||
return EPOLLERR | EPOLLHUP;
|
||||
|
||||
if (hvt->outmsg_len > 0)
|
||||
return POLLIN | POLLRDNORM;
|
||||
return EPOLLIN | EPOLLRDNORM;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
@ -222,7 +222,7 @@ void iio_dma_buffer_block_done(struct iio_dma_buffer_block *block)
|
||||
spin_unlock_irqrestore(&queue->list_lock, flags);
|
||||
|
||||
iio_buffer_block_put_atomic(block);
|
||||
wake_up_interruptible_poll(&queue->buffer.pollq, POLLIN | POLLRDNORM);
|
||||
wake_up_interruptible_poll(&queue->buffer.pollq, EPOLLIN | EPOLLRDNORM);
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(iio_dma_buffer_block_done);
|
||||
|
||||
@ -251,7 +251,7 @@ void iio_dma_buffer_block_list_abort(struct iio_dma_buffer_queue *queue,
|
||||
}
|
||||
spin_unlock_irqrestore(&queue->list_lock, flags);
|
||||
|
||||
wake_up_interruptible_poll(&queue->buffer.pollq, POLLIN | POLLRDNORM);
|
||||
wake_up_interruptible_poll(&queue->buffer.pollq, EPOLLIN | EPOLLRDNORM);
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(iio_dma_buffer_block_list_abort);
|
||||
|
||||
|
@ -166,7 +166,7 @@ ssize_t iio_buffer_read_first_n_outer(struct file *filp, char __user *buf,
|
||||
* @wait: Poll table structure pointer for which the driver adds
|
||||
* a wait queue
|
||||
*
|
||||
* Return: (POLLIN | POLLRDNORM) if data is available for reading
|
||||
* Return: (EPOLLIN | EPOLLRDNORM) if data is available for reading
|
||||
* or 0 for other cases
|
||||
*/
|
||||
__poll_t iio_buffer_poll(struct file *filp,
|
||||
@ -180,7 +180,7 @@ __poll_t iio_buffer_poll(struct file *filp,
|
||||
|
||||
poll_wait(filp, &rb->pollq, wait);
|
||||
if (iio_buffer_ready(indio_dev, rb, rb->watermark, 0))
|
||||
return POLLIN | POLLRDNORM;
|
||||
return EPOLLIN | EPOLLRDNORM;
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -1396,7 +1396,7 @@ static int iio_push_to_buffer(struct iio_buffer *buffer, const void *data)
|
||||
* We can't just test for watermark to decide if we wake the poll queue
|
||||
* because read may request less samples than the watermark.
|
||||
*/
|
||||
wake_up_interruptible_poll(&buffer->pollq, POLLIN | POLLRDNORM);
|
||||
wake_up_interruptible_poll(&buffer->pollq, EPOLLIN | EPOLLRDNORM);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -80,7 +80,7 @@ int iio_push_event(struct iio_dev *indio_dev, u64 ev_code, s64 timestamp)
|
||||
|
||||
copied = kfifo_put(&ev_int->det_events, ev);
|
||||
if (copied != 0)
|
||||
wake_up_poll(&ev_int->wait, POLLIN);
|
||||
wake_up_poll(&ev_int->wait, EPOLLIN);
|
||||
}
|
||||
|
||||
return 0;
|
||||
@ -92,7 +92,7 @@ EXPORT_SYMBOL(iio_push_event);
|
||||
* @filep: File structure pointer to identify the device
|
||||
* @wait: Poll table pointer to add the wait queue on
|
||||
*
|
||||
* Return: (POLLIN | POLLRDNORM) if data is available for reading
|
||||
* Return: (EPOLLIN | EPOLLRDNORM) if data is available for reading
|
||||
* or a negative error code on failure
|
||||
*/
|
||||
static __poll_t iio_event_poll(struct file *filep,
|
||||
@ -108,7 +108,7 @@ static __poll_t iio_event_poll(struct file *filep,
|
||||
poll_wait(filep, &ev_int->wait, wait);
|
||||
|
||||
if (!kfifo_is_empty(&ev_int->det_events))
|
||||
events = POLLIN | POLLRDNORM;
|
||||
events = EPOLLIN | EPOLLRDNORM;
|
||||
|
||||
return events;
|
||||
}
|
||||
|
@ -1144,7 +1144,7 @@ static __poll_t ib_ucm_poll(struct file *filp,
|
||||
poll_wait(filp, &file->poll_wait, wait);
|
||||
|
||||
if (!list_empty(&file->events))
|
||||
mask = POLLIN | POLLRDNORM;
|
||||
mask = EPOLLIN | EPOLLRDNORM;
|
||||
|
||||
return mask;
|
||||
}
|
||||
|
@ -1639,7 +1639,7 @@ static __poll_t ucma_poll(struct file *filp, struct poll_table_struct *wait)
|
||||
poll_wait(filp, &file->poll_wait, wait);
|
||||
|
||||
if (!list_empty(&file->event_list))
|
||||
mask = POLLIN | POLLRDNORM;
|
||||
mask = EPOLLIN | EPOLLRDNORM;
|
||||
|
||||
return mask;
|
||||
}
|
||||
|
@ -633,12 +633,12 @@ static __poll_t ib_umad_poll(struct file *filp, struct poll_table_struct *wait)
|
||||
struct ib_umad_file *file = filp->private_data;
|
||||
|
||||
/* we will always be able to post a MAD send */
|
||||
__poll_t mask = POLLOUT | POLLWRNORM;
|
||||
__poll_t mask = EPOLLOUT | EPOLLWRNORM;
|
||||
|
||||
poll_wait(filp, &file->recv_wait, wait);
|
||||
|
||||
if (!list_empty(&file->recv_list))
|
||||
mask |= POLLIN | POLLRDNORM;
|
||||
mask |= EPOLLIN | EPOLLRDNORM;
|
||||
|
||||
return mask;
|
||||
}
|
||||
|
@ -351,7 +351,7 @@ static __poll_t ib_uverbs_event_poll(struct ib_uverbs_event_queue *ev_queue,
|
||||
|
||||
spin_lock_irq(&ev_queue->lock);
|
||||
if (!list_empty(&ev_queue->event_list))
|
||||
pollflags = POLLIN | POLLRDNORM;
|
||||
pollflags = EPOLLIN | EPOLLRDNORM;
|
||||
spin_unlock_irq(&ev_queue->lock);
|
||||
|
||||
return pollflags;
|
||||
|
@ -612,13 +612,13 @@ static __poll_t hfi1_poll(struct file *fp, struct poll_table_struct *pt)
|
||||
|
||||
uctxt = ((struct hfi1_filedata *)fp->private_data)->uctxt;
|
||||
if (!uctxt)
|
||||
pollflag = POLLERR;
|
||||
pollflag = EPOLLERR;
|
||||
else if (uctxt->poll_type == HFI1_POLL_TYPE_URGENT)
|
||||
pollflag = poll_urgent(fp, pt);
|
||||
else if (uctxt->poll_type == HFI1_POLL_TYPE_ANYRCV)
|
||||
pollflag = poll_next(fp, pt);
|
||||
else /* invalid */
|
||||
pollflag = POLLERR;
|
||||
pollflag = EPOLLERR;
|
||||
|
||||
return pollflag;
|
||||
}
|
||||
@ -1435,7 +1435,7 @@ static __poll_t poll_urgent(struct file *fp,
|
||||
|
||||
spin_lock_irq(&dd->uctxt_lock);
|
||||
if (uctxt->urgent != uctxt->urgent_poll) {
|
||||
pollflag = POLLIN | POLLRDNORM;
|
||||
pollflag = EPOLLIN | EPOLLRDNORM;
|
||||
uctxt->urgent_poll = uctxt->urgent;
|
||||
} else {
|
||||
pollflag = 0;
|
||||
@ -1462,7 +1462,7 @@ static __poll_t poll_next(struct file *fp,
|
||||
hfi1_rcvctrl(dd, HFI1_RCVCTRL_INTRAVAIL_ENB, uctxt);
|
||||
pollflag = 0;
|
||||
} else {
|
||||
pollflag = POLLIN | POLLRDNORM;
|
||||
pollflag = EPOLLIN | EPOLLRDNORM;
|
||||
}
|
||||
spin_unlock_irq(&dd->uctxt_lock);
|
||||
|
||||
|
@ -1085,7 +1085,7 @@ static __poll_t qib_poll_urgent(struct qib_ctxtdata *rcd,
|
||||
|
||||
spin_lock_irq(&dd->uctxt_lock);
|
||||
if (rcd->urgent != rcd->urgent_poll) {
|
||||
pollflag = POLLIN | POLLRDNORM;
|
||||
pollflag = EPOLLIN | EPOLLRDNORM;
|
||||
rcd->urgent_poll = rcd->urgent;
|
||||
} else {
|
||||
pollflag = 0;
|
||||
@ -1111,7 +1111,7 @@ static __poll_t qib_poll_next(struct qib_ctxtdata *rcd,
|
||||
dd->f_rcvctrl(rcd->ppd, QIB_RCVCTRL_INTRAVAIL_ENB, rcd->ctxt);
|
||||
pollflag = 0;
|
||||
} else
|
||||
pollflag = POLLIN | POLLRDNORM;
|
||||
pollflag = EPOLLIN | EPOLLRDNORM;
|
||||
spin_unlock_irq(&dd->uctxt_lock);
|
||||
|
||||
return pollflag;
|
||||
@ -1124,13 +1124,13 @@ static __poll_t qib_poll(struct file *fp, struct poll_table_struct *pt)
|
||||
|
||||
rcd = ctxt_fp(fp);
|
||||
if (!rcd)
|
||||
pollflag = POLLERR;
|
||||
pollflag = EPOLLERR;
|
||||
else if (rcd->poll_type == QIB_POLL_TYPE_URGENT)
|
||||
pollflag = qib_poll_urgent(rcd, fp, pt);
|
||||
else if (rcd->poll_type == QIB_POLL_TYPE_ANYRCV)
|
||||
pollflag = qib_poll_next(rcd, fp, pt);
|
||||
else /* invalid */
|
||||
pollflag = POLLERR;
|
||||
pollflag = EPOLLERR;
|
||||
|
||||
return pollflag;
|
||||
}
|
||||
|
@ -874,7 +874,7 @@ iscsi_iser_ep_poll(struct iscsi_endpoint *ep, int timeout_ms)
|
||||
iser_info("iser conn %p rc = %d\n", iser_conn, rc);
|
||||
|
||||
if (rc > 0)
|
||||
return 1; /* success, this is the equivalent of POLLOUT */
|
||||
return 1; /* success, this is the equivalent of EPOLLOUT */
|
||||
else if (!rc)
|
||||
return 0; /* timeout */
|
||||
else
|
||||
|
@ -650,12 +650,12 @@ static __poll_t evdev_poll(struct file *file, poll_table *wait)
|
||||
poll_wait(file, &evdev->wait, wait);
|
||||
|
||||
if (evdev->exist && !client->revoked)
|
||||
mask = POLLOUT | POLLWRNORM;
|
||||
mask = EPOLLOUT | EPOLLWRNORM;
|
||||
else
|
||||
mask = POLLHUP | POLLERR;
|
||||
mask = EPOLLHUP | EPOLLERR;
|
||||
|
||||
if (client->packet_head != client->tail)
|
||||
mask |= POLLIN | POLLRDNORM;
|
||||
mask |= EPOLLIN | EPOLLRDNORM;
|
||||
|
||||
return mask;
|
||||
}
|
||||
|
@ -1053,7 +1053,7 @@ static __poll_t input_proc_devices_poll(struct file *file, poll_table *wait)
|
||||
poll_wait(file, &input_devices_poll_wait, wait);
|
||||
if (file->f_version != input_devices_state) {
|
||||
file->f_version = input_devices_state;
|
||||
return POLLIN | POLLRDNORM;
|
||||
return EPOLLIN | EPOLLRDNORM;
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
@ -442,8 +442,8 @@ static __poll_t joydev_poll(struct file *file, poll_table *wait)
|
||||
struct joydev *joydev = client->joydev;
|
||||
|
||||
poll_wait(file, &joydev->wait, wait);
|
||||
return (joydev_data_pending(client) ? (POLLIN | POLLRDNORM) : 0) |
|
||||
(joydev->exist ? 0 : (POLLHUP | POLLERR));
|
||||
return (joydev_data_pending(client) ? (EPOLLIN | EPOLLRDNORM) : 0) |
|
||||
(joydev->exist ? 0 : (EPOLLHUP | EPOLLERR));
|
||||
}
|
||||
|
||||
static int joydev_handle_JSIOCSAXMAP(struct joydev *joydev,
|
||||
|
@ -414,7 +414,7 @@ static __poll_t hp_sdc_rtc_poll(struct file *file, poll_table *wait)
|
||||
|
||||
l = 0;
|
||||
if (l != 0)
|
||||
return POLLIN | POLLRDNORM;
|
||||
return EPOLLIN | EPOLLRDNORM;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -704,7 +704,7 @@ static __poll_t uinput_poll(struct file *file, poll_table *wait)
|
||||
poll_wait(file, &udev->waitq, wait);
|
||||
|
||||
if (udev->head != udev->tail)
|
||||
return POLLIN | POLLRDNORM;
|
||||
return EPOLLIN | EPOLLRDNORM;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
@ -765,9 +765,9 @@ static __poll_t mousedev_poll(struct file *file, poll_table *wait)
|
||||
|
||||
poll_wait(file, &mousedev->wait, wait);
|
||||
|
||||
mask = mousedev->exist ? POLLOUT | POLLWRNORM : POLLHUP | POLLERR;
|
||||
mask = mousedev->exist ? EPOLLOUT | EPOLLWRNORM : EPOLLHUP | EPOLLERR;
|
||||
if (client->ready || client->buffer)
|
||||
mask |= POLLIN | POLLRDNORM;
|
||||
mask |= EPOLLIN | EPOLLRDNORM;
|
||||
|
||||
return mask;
|
||||
}
|
||||
|
@ -247,9 +247,9 @@ static __poll_t serio_raw_poll(struct file *file, poll_table *wait)
|
||||
|
||||
poll_wait(file, &serio_raw->wait, wait);
|
||||
|
||||
mask = serio_raw->dead ? POLLHUP | POLLERR : POLLOUT | POLLWRNORM;
|
||||
mask = serio_raw->dead ? EPOLLHUP | EPOLLERR : EPOLLOUT | EPOLLWRNORM;
|
||||
if (serio_raw->head != serio_raw->tail)
|
||||
mask |= POLLIN | POLLRDNORM;
|
||||
mask |= EPOLLIN | EPOLLRDNORM;
|
||||
|
||||
return mask;
|
||||
}
|
||||
|
@ -255,7 +255,7 @@ static __poll_t userio_char_poll(struct file *file, poll_table *wait)
|
||||
poll_wait(file, &userio->waitq, wait);
|
||||
|
||||
if (userio->head != userio->tail)
|
||||
return POLLIN | POLLRDNORM;
|
||||
return EPOLLIN | EPOLLRDNORM;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
|
@ -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 */
|
||||
|
@ -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);
|
||||
}
|
||||
|
@ -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)
|
||||
|
@ -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 = {
|
||||
|
@ -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)
|
||||
|
@ -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 */
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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));
|
||||
|
@ -183,7 +183,7 @@ static __poll_t uleds_poll(struct file *file, poll_table *wait)
|
||||
poll_wait(file, &udev->waitq, wait);
|
||||
|
||||
if (udev->new_data)
|
||||
return POLLIN | POLLRDNORM;
|
||||
return EPOLLIN | EPOLLRDNORM;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
@ -1259,7 +1259,7 @@ static __poll_t smu_fpoll(struct file *file, poll_table *wait)
|
||||
|
||||
spin_lock_irqsave(&pp->lock, flags);
|
||||
if (pp->busy && pp->cmd.status != 1)
|
||||
mask |= POLLIN;
|
||||
mask |= EPOLLIN;
|
||||
spin_unlock_irqrestore(&pp->lock, flags);
|
||||
}
|
||||
if (pp->mode == smu_file_events) {
|
||||
|
@ -2169,7 +2169,7 @@ pmu_fpoll(struct file *filp, poll_table *wait)
|
||||
poll_wait(filp, &pp->wait, wait);
|
||||
spin_lock_irqsave(&pp->lock, flags);
|
||||
if (pp->rb_get != pp->rb_put)
|
||||
mask |= POLLIN;
|
||||
mask |= EPOLLIN;
|
||||
spin_unlock_irqrestore(&pp->lock, flags);
|
||||
return mask;
|
||||
}
|
||||
|
@ -243,7 +243,7 @@ mbox_test_message_poll(struct file *filp, struct poll_table_struct *wait)
|
||||
poll_wait(filp, &tdev->waitq, wait);
|
||||
|
||||
if (mbox_test_message_data_ready(tdev))
|
||||
return POLLIN | POLLRDNORM;
|
||||
return EPOLLIN | EPOLLRDNORM;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -1937,7 +1937,7 @@ static __poll_t dm_poll(struct file *filp, poll_table *wait)
|
||||
poll_wait(filp, &dm_global_eventq, wait);
|
||||
|
||||
if ((int)(atomic_read(&dm_global_event_nr) - priv->global_event_nr) > 0)
|
||||
mask |= POLLIN;
|
||||
mask |= EPOLLIN;
|
||||
|
||||
return mask;
|
||||
}
|
||||
|
@ -7891,14 +7891,14 @@ static __poll_t mdstat_poll(struct file *filp, poll_table *wait)
|
||||
__poll_t mask;
|
||||
|
||||
if (md_unloading)
|
||||
return POLLIN|POLLRDNORM|POLLERR|POLLPRI;
|
||||
return EPOLLIN|EPOLLRDNORM|EPOLLERR|EPOLLPRI;
|
||||
poll_wait(filp, &md_event_waiters, wait);
|
||||
|
||||
/* always allow read */
|
||||
mask = POLLIN | POLLRDNORM;
|
||||
mask = EPOLLIN | EPOLLRDNORM;
|
||||
|
||||
if (seq->poll_event != atomic_read(&md_event_count))
|
||||
mask |= POLLERR | POLLPRI;
|
||||
mask |= EPOLLERR | EPOLLPRI;
|
||||
return mask;
|
||||
}
|
||||
|
||||
|
@ -51,15 +51,15 @@ static __poll_t cec_poll(struct file *filp,
|
||||
__poll_t res = 0;
|
||||
|
||||
if (!cec_is_registered(adap))
|
||||
return POLLERR | POLLHUP;
|
||||
return EPOLLERR | EPOLLHUP;
|
||||
mutex_lock(&adap->lock);
|
||||
if (adap->is_configured &&
|
||||
adap->transmit_queue_sz < CEC_MAX_MSG_TX_QUEUE_SZ)
|
||||
res |= POLLOUT | POLLWRNORM;
|
||||
res |= EPOLLOUT | EPOLLWRNORM;
|
||||
if (fh->queued_msgs)
|
||||
res |= POLLIN | POLLRDNORM;
|
||||
res |= EPOLLIN | EPOLLRDNORM;
|
||||
if (fh->total_queued_events)
|
||||
res |= POLLPRI;
|
||||
res |= EPOLLPRI;
|
||||
poll_wait(filp, &fh->wait, poll);
|
||||
mutex_unlock(&adap->lock);
|
||||
return res;
|
||||
|
@ -332,7 +332,7 @@ static __poll_t __fops_poll(struct file *file, struct poll_table_struct *wait)
|
||||
|
||||
if (vdev->vfl_type == VFL_TYPE_VBI) {
|
||||
if (fh->dev->ext_vv_data->capabilities & V4L2_CAP_SLICED_VBI_OUTPUT)
|
||||
return res | POLLOUT | POLLWRNORM;
|
||||
return res | EPOLLOUT | EPOLLWRNORM;
|
||||
if( 0 == fh->vbi_q.streaming )
|
||||
return res | videobuf_poll_stream(file, &fh->vbi_q, wait);
|
||||
q = &fh->vbi_q;
|
||||
@ -346,13 +346,13 @@ static __poll_t __fops_poll(struct file *file, struct poll_table_struct *wait)
|
||||
|
||||
if (!buf) {
|
||||
DEB_D("buf == NULL!\n");
|
||||
return res | POLLERR;
|
||||
return res | EPOLLERR;
|
||||
}
|
||||
|
||||
poll_wait(file, &buf->done, wait);
|
||||
if (buf->state == VIDEOBUF_DONE || buf->state == VIDEOBUF_ERROR) {
|
||||
DEB_D("poll succeeded!\n");
|
||||
return res | POLLIN | POLLRDNORM;
|
||||
return res | EPOLLIN | EPOLLRDNORM;
|
||||
}
|
||||
|
||||
DEB_D("nothing to poll for, buf->state:%d\n", buf->state);
|
||||
|
@ -371,7 +371,7 @@ static __poll_t smsdvb_stats_poll(struct file *file, poll_table *wait)
|
||||
rc = smsdvb_stats_wait_read(debug_data);
|
||||
kref_put(&debug_data->refcount, smsdvb_debugfs_data_release);
|
||||
|
||||
return rc > 0 ? POLLIN | POLLRDNORM : 0;
|
||||
return rc > 0 ? EPOLLIN | EPOLLRDNORM : 0;
|
||||
}
|
||||
|
||||
static ssize_t smsdvb_stats_read(struct file *file, char __user *user_buf,
|
||||
|
@ -2038,9 +2038,9 @@ __poll_t vb2_core_poll(struct vb2_queue *q, struct file *file,
|
||||
struct vb2_buffer *vb = NULL;
|
||||
unsigned long flags;
|
||||
|
||||
if (!q->is_output && !(req_events & (POLLIN | POLLRDNORM)))
|
||||
if (!q->is_output && !(req_events & (EPOLLIN | EPOLLRDNORM)))
|
||||
return 0;
|
||||
if (q->is_output && !(req_events & (POLLOUT | POLLWRNORM)))
|
||||
if (q->is_output && !(req_events & (EPOLLOUT | EPOLLWRNORM)))
|
||||
return 0;
|
||||
|
||||
/*
|
||||
@ -2048,18 +2048,18 @@ __poll_t vb2_core_poll(struct vb2_queue *q, struct file *file,
|
||||
*/
|
||||
if (q->num_buffers == 0 && !vb2_fileio_is_active(q)) {
|
||||
if (!q->is_output && (q->io_modes & VB2_READ) &&
|
||||
(req_events & (POLLIN | POLLRDNORM))) {
|
||||
(req_events & (EPOLLIN | EPOLLRDNORM))) {
|
||||
if (__vb2_init_fileio(q, 1))
|
||||
return POLLERR;
|
||||
return EPOLLERR;
|
||||
}
|
||||
if (q->is_output && (q->io_modes & VB2_WRITE) &&
|
||||
(req_events & (POLLOUT | POLLWRNORM))) {
|
||||
(req_events & (EPOLLOUT | EPOLLWRNORM))) {
|
||||
if (__vb2_init_fileio(q, 0))
|
||||
return POLLERR;
|
||||
return EPOLLERR;
|
||||
/*
|
||||
* Write to OUTPUT queue can be done immediately.
|
||||
*/
|
||||
return POLLOUT | POLLWRNORM;
|
||||
return EPOLLOUT | EPOLLWRNORM;
|
||||
}
|
||||
}
|
||||
|
||||
@ -2068,24 +2068,24 @@ __poll_t vb2_core_poll(struct vb2_queue *q, struct file *file,
|
||||
* error flag is set.
|
||||
*/
|
||||
if (!vb2_is_streaming(q) || q->error)
|
||||
return POLLERR;
|
||||
return EPOLLERR;
|
||||
|
||||
/*
|
||||
* If this quirk is set and QBUF hasn't been called yet then
|
||||
* return POLLERR as well. This only affects capture queues, output
|
||||
* return EPOLLERR as well. This only affects capture queues, output
|
||||
* queues will always initialize waiting_for_buffers to false.
|
||||
* This quirk is set by V4L2 for backwards compatibility reasons.
|
||||
*/
|
||||
if (q->quirk_poll_must_check_waiting_for_buffers &&
|
||||
q->waiting_for_buffers && (req_events & (POLLIN | POLLRDNORM)))
|
||||
return POLLERR;
|
||||
q->waiting_for_buffers && (req_events & (EPOLLIN | EPOLLRDNORM)))
|
||||
return EPOLLERR;
|
||||
|
||||
/*
|
||||
* For output streams you can call write() as long as there are fewer
|
||||
* buffers queued than there are buffers available.
|
||||
*/
|
||||
if (q->is_output && q->fileio && q->queued_count < q->num_buffers)
|
||||
return POLLOUT | POLLWRNORM;
|
||||
return EPOLLOUT | EPOLLWRNORM;
|
||||
|
||||
if (list_empty(&q->done_list)) {
|
||||
/*
|
||||
@ -2093,7 +2093,7 @@ __poll_t vb2_core_poll(struct vb2_queue *q, struct file *file,
|
||||
* return immediately. DQBUF will return -EPIPE.
|
||||
*/
|
||||
if (q->last_buffer_dequeued)
|
||||
return POLLIN | POLLRDNORM;
|
||||
return EPOLLIN | EPOLLRDNORM;
|
||||
|
||||
poll_wait(file, &q->done_wq, wait);
|
||||
}
|
||||
@ -2110,8 +2110,8 @@ __poll_t vb2_core_poll(struct vb2_queue *q, struct file *file,
|
||||
if (vb && (vb->state == VB2_BUF_STATE_DONE
|
||||
|| vb->state == VB2_BUF_STATE_ERROR)) {
|
||||
return (q->is_output) ?
|
||||
POLLOUT | POLLWRNORM :
|
||||
POLLIN | POLLRDNORM;
|
||||
EPOLLOUT | EPOLLWRNORM :
|
||||
EPOLLIN | EPOLLRDNORM;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
@ -658,7 +658,7 @@ int vb2_queue_init(struct vb2_queue *q)
|
||||
== V4L2_BUF_FLAG_TIMESTAMP_COPY;
|
||||
/*
|
||||
* For compatibility with vb1: if QBUF hasn't been called yet, then
|
||||
* return POLLERR as well. This only affects capture queues, output
|
||||
* return EPOLLERR as well. This only affects capture queues, output
|
||||
* queues will always initialize waiting_for_buffers to false.
|
||||
*/
|
||||
q->quirk_poll_must_check_waiting_for_buffers = true;
|
||||
@ -683,8 +683,8 @@ __poll_t vb2_poll(struct vb2_queue *q, struct file *file, poll_table *wait)
|
||||
struct v4l2_fh *fh = file->private_data;
|
||||
|
||||
if (v4l2_event_pending(fh))
|
||||
res = POLLPRI;
|
||||
else if (req_events & POLLPRI)
|
||||
res = EPOLLPRI;
|
||||
else if (req_events & EPOLLPRI)
|
||||
poll_wait(file, &fh->wait, wait);
|
||||
}
|
||||
|
||||
@ -921,7 +921,7 @@ __poll_t vb2_fop_poll(struct file *file, poll_table *wait)
|
||||
WARN_ON(!lock);
|
||||
|
||||
if (lock && mutex_lock_interruptible(lock))
|
||||
return POLLERR;
|
||||
return EPOLLERR;
|
||||
|
||||
fileio = q->fileio;
|
||||
|
||||
|
@ -1179,7 +1179,7 @@ static __poll_t dvb_demux_poll(struct file *file, poll_table *wait)
|
||||
__poll_t mask = 0;
|
||||
|
||||
if ((!dmxdevfilter) || dmxdevfilter->dev->exit)
|
||||
return POLLERR;
|
||||
return EPOLLERR;
|
||||
if (dvb_vb2_is_streaming(&dmxdevfilter->vb2_ctx))
|
||||
return dvb_vb2_poll(&dmxdevfilter->vb2_ctx, file, wait);
|
||||
|
||||
@ -1191,10 +1191,10 @@ static __poll_t dvb_demux_poll(struct file *file, poll_table *wait)
|
||||
return 0;
|
||||
|
||||
if (dmxdevfilter->buffer.error)
|
||||
mask |= (POLLIN | POLLRDNORM | POLLPRI | POLLERR);
|
||||
mask |= (EPOLLIN | EPOLLRDNORM | EPOLLPRI | EPOLLERR);
|
||||
|
||||
if (!dvb_ringbuffer_empty(&dmxdevfilter->buffer))
|
||||
mask |= (POLLIN | POLLRDNORM | POLLPRI);
|
||||
mask |= (EPOLLIN | EPOLLRDNORM | EPOLLPRI);
|
||||
|
||||
return mask;
|
||||
}
|
||||
@ -1331,7 +1331,7 @@ static __poll_t dvb_dvr_poll(struct file *file, poll_table *wait)
|
||||
dprintk("%s\n", __func__);
|
||||
|
||||
if (dmxdev->exit)
|
||||
return POLLERR;
|
||||
return EPOLLERR;
|
||||
if (dvb_vb2_is_streaming(&dmxdev->dvr_vb2_ctx))
|
||||
return dvb_vb2_poll(&dmxdev->dvr_vb2_ctx, file, wait);
|
||||
|
||||
@ -1343,12 +1343,12 @@ static __poll_t dvb_dvr_poll(struct file *file, poll_table *wait)
|
||||
#endif
|
||||
if (need_ringbuffer) {
|
||||
if (dmxdev->dvr_buffer.error)
|
||||
mask |= (POLLIN | POLLRDNORM | POLLPRI | POLLERR);
|
||||
mask |= (EPOLLIN | EPOLLRDNORM | EPOLLPRI | EPOLLERR);
|
||||
|
||||
if (!dvb_ringbuffer_empty(&dmxdev->dvr_buffer))
|
||||
mask |= (POLLIN | POLLRDNORM | POLLPRI);
|
||||
mask |= (EPOLLIN | EPOLLRDNORM | EPOLLPRI);
|
||||
} else
|
||||
mask |= (POLLOUT | POLLWRNORM | POLLPRI);
|
||||
mask |= (EPOLLOUT | EPOLLWRNORM | EPOLLPRI);
|
||||
|
||||
return mask;
|
||||
}
|
||||
|
@ -1796,7 +1796,7 @@ static __poll_t dvb_ca_en50221_io_poll(struct file *file, poll_table *wait)
|
||||
dprintk("%s\n", __func__);
|
||||
|
||||
if (dvb_ca_en50221_io_read_condition(ca, &result, &slot) == 1)
|
||||
mask |= POLLIN;
|
||||
mask |= EPOLLIN;
|
||||
|
||||
/* if there is something, return now */
|
||||
if (mask)
|
||||
@ -1806,7 +1806,7 @@ static __poll_t dvb_ca_en50221_io_poll(struct file *file, poll_table *wait)
|
||||
poll_wait(file, &ca->wait_queue, wait);
|
||||
|
||||
if (dvb_ca_en50221_io_read_condition(ca, &result, &slot) == 1)
|
||||
mask |= POLLIN;
|
||||
mask |= EPOLLIN;
|
||||
|
||||
return mask;
|
||||
}
|
||||
|
@ -2646,7 +2646,7 @@ static __poll_t dvb_frontend_poll(struct file *file, struct poll_table_struct *w
|
||||
poll_wait (file, &fepriv->events.wait_queue, wait);
|
||||
|
||||
if (fepriv->events.eventw != fepriv->events.eventr)
|
||||
return (POLLIN | POLLRDNORM | POLLPRI);
|
||||
return (EPOLLIN | EPOLLRDNORM | EPOLLPRI);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
@ -209,7 +209,7 @@ static int fdtv_ca_ioctl(struct file *file, unsigned int cmd, void *arg)
|
||||
|
||||
static __poll_t fdtv_ca_io_poll(struct file *file, poll_table *wait)
|
||||
{
|
||||
return POLLIN;
|
||||
return EPOLLIN;
|
||||
}
|
||||
|
||||
static const struct file_operations fdtv_ca_fops = {
|
||||
|
@ -413,7 +413,7 @@ static long saa6588_ioctl(struct v4l2_subdev *sd, unsigned int cmd, void *arg)
|
||||
case SAA6588_CMD_POLL:
|
||||
a->result = 0;
|
||||
if (s->data_available_for_read)
|
||||
a->result |= POLLIN | POLLRDNORM;
|
||||
a->result |= EPOLLIN | EPOLLRDNORM;
|
||||
poll_wait(a->instance, &s->read_queue, a->event_list);
|
||||
break;
|
||||
|
||||
|
@ -105,7 +105,7 @@ static __poll_t media_poll(struct file *filp,
|
||||
struct media_devnode *devnode = media_devnode_data(filp);
|
||||
|
||||
if (!media_devnode_is_registered(devnode))
|
||||
return POLLERR | POLLHUP;
|
||||
return EPOLLERR | EPOLLHUP;
|
||||
if (!devnode->fops->poll)
|
||||
return DEFAULT_POLLMASK;
|
||||
return devnode->fops->poll(filp, poll);
|
||||
|
@ -2964,39 +2964,39 @@ static __poll_t bttv_poll(struct file *file, poll_table *wait)
|
||||
__poll_t req_events = poll_requested_events(wait);
|
||||
|
||||
if (v4l2_event_pending(&fh->fh))
|
||||
rc = POLLPRI;
|
||||
else if (req_events & POLLPRI)
|
||||
rc = EPOLLPRI;
|
||||
else if (req_events & EPOLLPRI)
|
||||
poll_wait(file, &fh->fh.wait, wait);
|
||||
|
||||
if (!(req_events & (POLLIN | POLLRDNORM)))
|
||||
if (!(req_events & (EPOLLIN | EPOLLRDNORM)))
|
||||
return rc;
|
||||
|
||||
if (V4L2_BUF_TYPE_VBI_CAPTURE == fh->type) {
|
||||
if (!check_alloc_btres_lock(fh->btv,fh,RESOURCE_VBI))
|
||||
return rc | POLLERR;
|
||||
return rc | EPOLLERR;
|
||||
return rc | videobuf_poll_stream(file, &fh->vbi, wait);
|
||||
}
|
||||
|
||||
if (check_btres(fh,RESOURCE_VIDEO_STREAM)) {
|
||||
/* streaming capture */
|
||||
if (list_empty(&fh->cap.stream))
|
||||
return rc | POLLERR;
|
||||
return rc | EPOLLERR;
|
||||
buf = list_entry(fh->cap.stream.next,struct bttv_buffer,vb.stream);
|
||||
} else {
|
||||
/* read() capture */
|
||||
if (NULL == fh->cap.read_buf) {
|
||||
/* need to capture a new frame */
|
||||
if (locked_btres(fh->btv,RESOURCE_VIDEO_STREAM))
|
||||
return rc | POLLERR;
|
||||
return rc | EPOLLERR;
|
||||
fh->cap.read_buf = videobuf_sg_alloc(fh->cap.msize);
|
||||
if (NULL == fh->cap.read_buf)
|
||||
return rc | POLLERR;
|
||||
return rc | EPOLLERR;
|
||||
fh->cap.read_buf->memory = V4L2_MEMORY_USERPTR;
|
||||
field = videobuf_next_field(&fh->cap);
|
||||
if (0 != fh->cap.ops->buf_prepare(&fh->cap,fh->cap.read_buf,field)) {
|
||||
kfree (fh->cap.read_buf);
|
||||
fh->cap.read_buf = NULL;
|
||||
return rc | POLLERR;
|
||||
return rc | EPOLLERR;
|
||||
}
|
||||
fh->cap.ops->buf_queue(&fh->cap,fh->cap.read_buf);
|
||||
fh->cap.read_off = 0;
|
||||
@ -3007,7 +3007,7 @@ static __poll_t bttv_poll(struct file *file, poll_table *wait)
|
||||
poll_wait(file, &buf->vb.done, wait);
|
||||
if (buf->vb.state == VIDEOBUF_DONE ||
|
||||
buf->vb.state == VIDEOBUF_ERROR)
|
||||
rc = rc | POLLIN|POLLRDNORM;
|
||||
rc = rc | EPOLLIN|EPOLLRDNORM;
|
||||
return rc;
|
||||
}
|
||||
|
||||
@ -3338,8 +3338,8 @@ static __poll_t radio_poll(struct file *file, poll_table *wait)
|
||||
__poll_t res = 0;
|
||||
|
||||
if (v4l2_event_pending(&fh->fh))
|
||||
res = POLLPRI;
|
||||
else if (req_events & POLLPRI)
|
||||
res = EPOLLPRI;
|
||||
else if (req_events & EPOLLPRI)
|
||||
poll_wait(file, &fh->fh.wait, wait);
|
||||
radio_enable(btv);
|
||||
cmd.instance = file;
|
||||
|
@ -613,7 +613,7 @@ __poll_t cx18_v4l2_enc_poll(struct file *filp, poll_table *wait)
|
||||
|
||||
/* Start a capture if there is none */
|
||||
if (!eof && !test_bit(CX18_F_S_STREAMING, &s->s_flags) &&
|
||||
(req_events & (POLLIN | POLLRDNORM))) {
|
||||
(req_events & (EPOLLIN | EPOLLRDNORM))) {
|
||||
int rc;
|
||||
|
||||
mutex_lock(&cx->serialize_lock);
|
||||
@ -622,7 +622,7 @@ __poll_t cx18_v4l2_enc_poll(struct file *filp, poll_table *wait)
|
||||
if (rc) {
|
||||
CX18_DEBUG_INFO("Could not start capture for %s (%d)\n",
|
||||
s->name, rc);
|
||||
return POLLERR;
|
||||
return EPOLLERR;
|
||||
}
|
||||
CX18_DEBUG_FILE("Encoder poll started capture\n");
|
||||
}
|
||||
@ -632,23 +632,23 @@ __poll_t cx18_v4l2_enc_poll(struct file *filp, poll_table *wait)
|
||||
__poll_t videobuf_poll = videobuf_poll_stream(filp, &s->vbuf_q, wait);
|
||||
|
||||
if (v4l2_event_pending(&id->fh))
|
||||
res |= POLLPRI;
|
||||
if (eof && videobuf_poll == POLLERR)
|
||||
return res | POLLHUP;
|
||||
res |= EPOLLPRI;
|
||||
if (eof && videobuf_poll == EPOLLERR)
|
||||
return res | EPOLLHUP;
|
||||
return res | videobuf_poll;
|
||||
}
|
||||
|
||||
/* add stream's waitq to the poll list */
|
||||
CX18_DEBUG_HI_FILE("Encoder poll\n");
|
||||
if (v4l2_event_pending(&id->fh))
|
||||
res |= POLLPRI;
|
||||
res |= EPOLLPRI;
|
||||
else
|
||||
poll_wait(filp, &s->waitq, wait);
|
||||
|
||||
if (atomic_read(&s->q_full.depth))
|
||||
return res | POLLIN | POLLRDNORM;
|
||||
return res | EPOLLIN | EPOLLRDNORM;
|
||||
if (eof)
|
||||
return res | POLLHUP;
|
||||
return res | EPOLLHUP;
|
||||
return res;
|
||||
}
|
||||
|
||||
|
@ -745,9 +745,9 @@ static __poll_t ts_poll(struct file *file, poll_table *wait)
|
||||
poll_wait(file, &input->dma->wq, wait);
|
||||
poll_wait(file, &output->dma->wq, wait);
|
||||
if (ddb_input_avail(input) >= 188)
|
||||
mask |= POLLIN | POLLRDNORM;
|
||||
mask |= EPOLLIN | EPOLLRDNORM;
|
||||
if (ddb_output_free(output) >= 188)
|
||||
mask |= POLLOUT | POLLWRNORM;
|
||||
mask |= EPOLLOUT | EPOLLWRNORM;
|
||||
return mask;
|
||||
}
|
||||
|
||||
|
@ -747,7 +747,7 @@ __poll_t ivtv_v4l2_dec_poll(struct file *filp, poll_table *wait)
|
||||
/* Turn off the old-style vsync events */
|
||||
clear_bit(IVTV_F_I_EV_VSYNC_ENABLED, &itv->i_flags);
|
||||
if (v4l2_event_pending(&id->fh))
|
||||
res = POLLPRI;
|
||||
res = EPOLLPRI;
|
||||
} else {
|
||||
/* This is the old-style API which is here only for backwards
|
||||
compatibility. */
|
||||
@ -755,12 +755,12 @@ __poll_t ivtv_v4l2_dec_poll(struct file *filp, poll_table *wait)
|
||||
set_bit(IVTV_F_I_EV_VSYNC_ENABLED, &itv->i_flags);
|
||||
if (test_bit(IVTV_F_I_EV_VSYNC, &itv->i_flags) ||
|
||||
test_bit(IVTV_F_I_EV_DEC_STOPPED, &itv->i_flags))
|
||||
res = POLLPRI;
|
||||
res = EPOLLPRI;
|
||||
}
|
||||
|
||||
/* Allow write if buffers are available for writing */
|
||||
if (s->q_free.buffers)
|
||||
res |= POLLOUT | POLLWRNORM;
|
||||
res |= EPOLLOUT | EPOLLWRNORM;
|
||||
return res;
|
||||
}
|
||||
|
||||
@ -776,7 +776,7 @@ __poll_t ivtv_v4l2_enc_poll(struct file *filp, poll_table *wait)
|
||||
/* Start a capture if there is none */
|
||||
if (!eof && !test_bit(IVTV_F_S_STREAMING, &s->s_flags) &&
|
||||
s->type != IVTV_ENC_STREAM_TYPE_RAD &&
|
||||
(req_events & (POLLIN | POLLRDNORM))) {
|
||||
(req_events & (EPOLLIN | EPOLLRDNORM))) {
|
||||
int rc;
|
||||
|
||||
mutex_lock(&itv->serialize_lock);
|
||||
@ -785,7 +785,7 @@ __poll_t ivtv_v4l2_enc_poll(struct file *filp, poll_table *wait)
|
||||
if (rc) {
|
||||
IVTV_DEBUG_INFO("Could not start capture for %s (%d)\n",
|
||||
s->name, rc);
|
||||
return POLLERR;
|
||||
return EPOLLERR;
|
||||
}
|
||||
IVTV_DEBUG_FILE("Encoder poll started capture\n");
|
||||
}
|
||||
@ -794,14 +794,14 @@ __poll_t ivtv_v4l2_enc_poll(struct file *filp, poll_table *wait)
|
||||
IVTV_DEBUG_HI_FILE("Encoder poll\n");
|
||||
poll_wait(filp, &s->waitq, wait);
|
||||
if (v4l2_event_pending(&id->fh))
|
||||
res |= POLLPRI;
|
||||
res |= EPOLLPRI;
|
||||
else
|
||||
poll_wait(filp, &id->fh.wait, wait);
|
||||
|
||||
if (s->q_full.length || s->q_io.length)
|
||||
return res | POLLIN | POLLRDNORM;
|
||||
return res | EPOLLIN | EPOLLRDNORM;
|
||||
if (eof)
|
||||
return res | POLLHUP;
|
||||
return res | EPOLLHUP;
|
||||
return res;
|
||||
}
|
||||
|
||||
|
@ -1430,7 +1430,7 @@ static __poll_t meye_poll(struct file *file, poll_table *wait)
|
||||
mutex_lock(&meye.lock);
|
||||
poll_wait(file, &meye.proc_list, wait);
|
||||
if (kfifo_len(&meye.doneq))
|
||||
res |= POLLIN | POLLRDNORM;
|
||||
res |= EPOLLIN | EPOLLRDNORM;
|
||||
mutex_unlock(&meye.lock);
|
||||
return res;
|
||||
}
|
||||
|
@ -925,13 +925,13 @@ static __poll_t fops_poll(struct file *file, poll_table *wait)
|
||||
saa7164_histogram_update(&port->poll_interval,
|
||||
port->last_poll_msecs_diff);
|
||||
|
||||
if (!(req_events & (POLLIN | POLLRDNORM)))
|
||||
if (!(req_events & (EPOLLIN | EPOLLRDNORM)))
|
||||
return mask;
|
||||
|
||||
if (atomic_cmpxchg(&fh->v4l_reading, 0, 1) == 0) {
|
||||
if (atomic_inc_return(&port->v4l_reader_count) == 1) {
|
||||
if (saa7164_encoder_initialize(port) < 0)
|
||||
return mask | POLLERR;
|
||||
return mask | EPOLLERR;
|
||||
saa7164_encoder_start_streaming(port);
|
||||
msleep(200);
|
||||
}
|
||||
@ -939,7 +939,7 @@ static __poll_t fops_poll(struct file *file, poll_table *wait)
|
||||
|
||||
/* Pull the first buffer from the used list */
|
||||
if (!list_empty(&port->list_buf_used.list))
|
||||
mask |= POLLIN | POLLRDNORM;
|
||||
mask |= EPOLLIN | EPOLLRDNORM;
|
||||
|
||||
return mask;
|
||||
}
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user