summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorMing Lei <ming.lei@redhat.com>2026-01-16 22:18:37 +0800
committerJens Axboe <axboe@kernel.dk>2026-01-22 20:05:40 -0700
commitb256795b3606e9a67c725dde8eaae91dd9d21de4 (patch)
treeb9f1b02d2392fd847ce10afe2735286889f7b078 /include
parente86f89ab24f5ec595879a01eebb5df84f5ed6d2b (diff)
ublk: handle UBLK_U_IO_PREP_IO_CMDS
This commit implements the handling of the UBLK_U_IO_PREP_IO_CMDS command, which allows userspace to prepare a batch of I/O requests. The core of this change is the `ublk_walk_cmd_buf` function, which iterates over the elements in the uring_cmd fixed buffer. For each element, it parses the I/O details, finds the corresponding `ublk_io` structure, and prepares it for future dispatch. Add per-io lock for protecting concurrent delivery and committing. Reviewed-by: Caleb Sander Mateos <csander@purestorage.com> Signed-off-by: Ming Lei <ming.lei@redhat.com> Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'include')
-rw-r--r--include/uapi/linux/ublk_cmd.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/include/uapi/linux/ublk_cmd.h b/include/uapi/linux/ublk_cmd.h
index 0cc58e19d401..1a3d4d33c1d1 100644
--- a/include/uapi/linux/ublk_cmd.h
+++ b/include/uapi/linux/ublk_cmd.h
@@ -103,6 +103,11 @@
_IOWR('u', 0x23, struct ublksrv_io_cmd)
#define UBLK_U_IO_UNREGISTER_IO_BUF \
_IOWR('u', 0x24, struct ublksrv_io_cmd)
+
+/*
+ * return 0 if the command is run successfully, otherwise failure code
+ * is returned
+ */
#define UBLK_U_IO_PREP_IO_CMDS \
_IOWR('u', 0x25, struct ublk_batch_io)
#define UBLK_U_IO_COMMIT_IO_CMDS \