diff options
| author | Pavel Begunkov <asml.silence@gmail.com> | 2025-06-16 10:46:27 +0100 |
|---|---|---|
| committer | Jens Axboe <axboe@kernel.dk> | 2025-06-23 09:00:12 -0600 |
| commit | b95575495948a81ac9b0110aa721ea061dd850d9 (patch) | |
| tree | 0a9f4e46441d6a0f8aa0dd1406f3bccec57aebec /io_uring/uring_cmd.h | |
| parent | 162151889267089bb920609830c35f9272087c3f (diff) | |
io_uring/cmd: allow multishot polled commands
Some commands like timestamping in the next patch can make use of
multishot polling, i.e. REQ_F_APOLL_MULTISHOT. Add support for that,
which is condensed in a single helper called io_cmd_poll_multishot().
The user who wants to continue with a request in a multishot mode must
call the function, and only if it returns 0 the user is free to proceed.
Apart from normal terminal errors, it can also end up with -EIOCBQUEUED,
in which case the user must forward it to the core io_uring. It's
forbidden to use task work while the request is executing in a multishot
mode.
The API is not foolproof, hence it's not exported to modules nor exposed
in public headers.
Signed-off-by: Pavel Begunkov <asml.silence@gmail.com>
Link: https://lore.kernel.org/r/bcf97c31659662c72b69fc8fcdf2a88cfc16e430.1750065793.git.asml.silence@gmail.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'io_uring/uring_cmd.h')
| -rw-r--r-- | io_uring/uring_cmd.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/io_uring/uring_cmd.h b/io_uring/uring_cmd.h index a6dad47afc6b..50a6ccb831df 100644 --- a/io_uring/uring_cmd.h +++ b/io_uring/uring_cmd.h @@ -18,3 +18,6 @@ bool io_uring_try_cancel_uring_cmd(struct io_ring_ctx *ctx, struct io_uring_task *tctx, bool cancel_all); void io_cmd_cache_free(const void *entry); + +int io_cmd_poll_multishot(struct io_uring_cmd *cmd, + unsigned int issue_flags, __poll_t mask); |