0001
0002
0003 #include "alloc_cache.h"
0004
0005 enum {
0006 IO_APOLL_OK,
0007 IO_APOLL_ABORTED,
0008 IO_APOLL_READY
0009 };
0010
0011 struct io_poll {
0012 struct file *file;
0013 struct wait_queue_head *head;
0014 __poll_t events;
0015 struct wait_queue_entry wait;
0016 };
0017
0018 struct async_poll {
0019 union {
0020 struct io_poll poll;
0021 struct io_cache_entry cache;
0022 };
0023 struct io_poll *double_poll;
0024 };
0025
0026 int io_poll_add_prep(struct io_kiocb *req, const struct io_uring_sqe *sqe);
0027 int io_poll_add(struct io_kiocb *req, unsigned int issue_flags);
0028
0029 int io_poll_remove_prep(struct io_kiocb *req, const struct io_uring_sqe *sqe);
0030 int io_poll_remove(struct io_kiocb *req, unsigned int issue_flags);
0031
0032 struct io_cancel_data;
0033 int io_poll_cancel(struct io_ring_ctx *ctx, struct io_cancel_data *cd,
0034 unsigned issue_flags);
0035 int io_arm_poll_handler(struct io_kiocb *req, unsigned issue_flags);
0036 bool io_poll_remove_all(struct io_ring_ctx *ctx, struct task_struct *tsk,
0037 bool cancel_all);
0038
0039 void io_apoll_cache_free(struct io_cache_entry *entry);