Lines Matching full:poll
19 #include <linux/poll.h>
157 struct vhost_poll *poll; in vhost_poll_func() local
159 poll = container_of(pt, struct vhost_poll, table); in vhost_poll_func()
160 poll->wqh = wqh; in vhost_poll_func()
161 add_wait_queue(wqh, &poll->wait); in vhost_poll_func()
167 struct vhost_poll *poll = container_of(wait, struct vhost_poll, wait); in vhost_poll_wakeup() local
168 struct vhost_work *work = &poll->work; in vhost_poll_wakeup()
170 if (!(key_to_poll(key) & poll->mask)) in vhost_poll_wakeup()
173 if (!poll->dev->use_worker) in vhost_poll_wakeup()
176 vhost_poll_queue(poll); in vhost_poll_wakeup()
188 /* Init poll structure */
189 void vhost_poll_init(struct vhost_poll *poll, vhost_work_fn_t fn, in vhost_poll_init() argument
192 init_waitqueue_func_entry(&poll->wait, vhost_poll_wakeup); in vhost_poll_init()
193 init_poll_funcptr(&poll->table, vhost_poll_func); in vhost_poll_init()
194 poll->mask = mask; in vhost_poll_init()
195 poll->dev = dev; in vhost_poll_init()
196 poll->wqh = NULL; in vhost_poll_init()
198 vhost_work_init(&poll->work, fn); in vhost_poll_init()
204 int vhost_poll_start(struct vhost_poll *poll, struct file *file) in vhost_poll_start() argument
208 if (poll->wqh) in vhost_poll_start()
211 mask = vfs_poll(file, &poll->table); in vhost_poll_start()
213 vhost_poll_wakeup(&poll->wait, 0, 0, poll_to_key(mask)); in vhost_poll_start()
215 vhost_poll_stop(poll); in vhost_poll_start()
225 void vhost_poll_stop(struct vhost_poll *poll) in vhost_poll_stop() argument
227 if (poll->wqh) { in vhost_poll_stop()
228 remove_wait_queue(poll->wqh, &poll->wait); in vhost_poll_stop()
229 poll->wqh = NULL; in vhost_poll_stop()
250 void vhost_poll_flush(struct vhost_poll *poll) in vhost_poll_flush() argument
252 vhost_work_flush(poll->dev, &poll->work); in vhost_poll_flush()
279 void vhost_poll_queue(struct vhost_poll *poll) in vhost_poll_queue() argument
281 vhost_work_queue(poll->dev, &poll->work); in vhost_poll_queue()
433 vhost_poll_queue(&vq->poll); in vhost_exceeds_weight()
506 vhost_poll_init(&vq->poll, vq->handle_kick, in vhost_dev_init()
665 vhost_poll_stop(&dev->vqs[i]->poll); in vhost_dev_stop()
666 vhost_poll_flush(&dev->vqs[i]->poll); in vhost_dev_stop()
1061 vhost_poll_queue(&node->vq->poll); in vhost_iotlb_notify_vq()
1696 vhost_poll_stop(&vq->poll); in vhost_vring_ioctl()
1704 r = vhost_poll_start(&vq->poll, vq->kick); in vhost_vring_ioctl()
1709 vhost_poll_flush(&vq->poll); in vhost_vring_ioctl()