2
0
mirror of git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git synced 2025-09-04 20:19:47 +08:00

io_uring/cmd: introduce IORING_URING_CMD_REISSUE flag

Add a flag IORING_URING_CMD_REISSUE that ->uring_cmd() implementations
can use to tell whether this is the first or subsequent issue of the
uring_cmd. This will allow ->uring_cmd() implementations to store
information in the io_uring_cmd's pdu across issues.

Signed-off-by: Caleb Sander Mateos <csander@purestorage.com>
Acked-by: David Sterba <dsterba@suse.com>
Link: https://lore.kernel.org/r/20250708202212.2851548-3-csander@purestorage.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
This commit is contained in:
Caleb Sander Mateos 2025-07-08 14:22:10 -06:00 committed by Jens Axboe
parent 262ab20518
commit 733c43f1df
2 changed files with 7 additions and 1 deletions

View File

@ -8,6 +8,8 @@
/* only top 8 bits of sqe->uring_cmd_flags for kernel internal use */ /* only top 8 bits of sqe->uring_cmd_flags for kernel internal use */
#define IORING_URING_CMD_CANCELABLE (1U << 30) #define IORING_URING_CMD_CANCELABLE (1U << 30)
/* io_uring_cmd is being issued again */
#define IORING_URING_CMD_REISSUE (1U << 31)
struct io_uring_cmd { struct io_uring_cmd {
struct file *file; struct file *file;

View File

@ -261,7 +261,11 @@ int io_uring_cmd(struct io_kiocb *req, unsigned int issue_flags)
} }
ret = file->f_op->uring_cmd(ioucmd, issue_flags); ret = file->f_op->uring_cmd(ioucmd, issue_flags);
if (ret == -EAGAIN || ret == -EIOCBQUEUED) if (ret == -EAGAIN) {
ioucmd->flags |= IORING_URING_CMD_REISSUE;
return ret;
}
if (ret == -EIOCBQUEUED)
return ret; return ret;
if (ret < 0) if (ret < 0)
req_set_fail(req); req_set_fail(req);