summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorMing Lei <ming.lei@redhat.com>2026-01-16 22:18:38 +0800
committerJens Axboe <axboe@kernel.dk>2026-01-22 20:05:40 -0700
commit1e500e106d5a82280db59dba06f0108085beba65 (patch)
treebdf8e7c4f988955ba943dd20cb60d4e0a6526774 /include
parentb256795b3606e9a67c725dde8eaae91dd9d21de4 (diff)
ublk: handle UBLK_U_IO_COMMIT_IO_CMDS
Handle UBLK_U_IO_COMMIT_IO_CMDS by walking the uring_cmd fixed buffer: - read each element into one temp buffer in batch style - parse and apply each element for committing io result 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.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/include/uapi/linux/ublk_cmd.h b/include/uapi/linux/ublk_cmd.h
index 1a3d4d33c1d1..3894d676dd02 100644
--- a/include/uapi/linux/ublk_cmd.h
+++ b/include/uapi/linux/ublk_cmd.h
@@ -110,6 +110,14 @@
*/
#define UBLK_U_IO_PREP_IO_CMDS \
_IOWR('u', 0x25, struct ublk_batch_io)
+/*
+ * If failure code is returned, nothing in the command buffer is handled.
+ * Otherwise, the returned value means how many bytes in command buffer
+ * are handled actually, then number of handled IOs can be calculated with
+ * `elem_bytes` for each IO. IOs in the remained bytes are not committed,
+ * userspace has to check return value for dealing with partial committing
+ * correctly.
+ */
#define UBLK_U_IO_COMMIT_IO_CMDS \
_IOWR('u', 0x26, struct ublk_batch_io)