summaryrefslogtreecommitdiffstats
path: root/io_uring/poll.h
diff options
context:
space:
mode:
authorJens Axboe <axboe@kernel.dk>2022-05-25 20:31:09 -0600
committerJens Axboe <axboe@kernel.dk>2022-07-24 18:39:12 -0600
commit329061d3e2f9a0082a097e9558bd5497098586c6 (patch)
tree3a0d34b89b6ef8df26c0ca04a7c60732ada208af /io_uring/poll.h
parentcfd22e6b3319adc7c2a8a092e19ac16575dabc86 (diff)
downloadlinux-329061d3e2f9a0082a097e9558bd5497098586c6.tar.gz
linux-329061d3e2f9a0082a097e9558bd5497098586c6.tar.bz2
linux-329061d3e2f9a0082a097e9558bd5497098586c6.zip
io_uring: move poll handling into its own file
Add a io_poll_issue() rather than export the general task_work locking and io_issue_sqe(), and put the io_op_defs definition and structure into a separate header file so that poll can use it. Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'io_uring/poll.h')
-rw-r--r--io_uring/poll.h30
1 files changed, 30 insertions, 0 deletions
diff --git a/io_uring/poll.h b/io_uring/poll.h
new file mode 100644
index 000000000000..cc75c1567a84
--- /dev/null
+++ b/io_uring/poll.h
@@ -0,0 +1,30 @@
+// SPDX-License-Identifier: GPL-2.0
+
+enum {
+ IO_APOLL_OK,
+ IO_APOLL_ABORTED,
+ IO_APOLL_READY
+};
+
+struct io_poll {
+ struct file *file;
+ struct wait_queue_head *head;
+ __poll_t events;
+ struct wait_queue_entry wait;
+};
+
+struct async_poll {
+ struct io_poll poll;
+ struct io_poll *double_poll;
+};
+
+int io_poll_add_prep(struct io_kiocb *req, const struct io_uring_sqe *sqe);
+int io_poll_add(struct io_kiocb *req, unsigned int issue_flags);
+
+int io_poll_remove_prep(struct io_kiocb *req, const struct io_uring_sqe *sqe);
+int io_poll_remove(struct io_kiocb *req, unsigned int issue_flags);
+
+int io_poll_cancel(struct io_ring_ctx *ctx, struct io_cancel_data *cd);
+int io_arm_poll_handler(struct io_kiocb *req, unsigned issue_flags);
+bool io_poll_remove_all(struct io_ring_ctx *ctx, struct task_struct *tsk,
+ bool cancel_all);