History

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.

Ming Lei committed 10 months ago

Commit b2567951 parent e86f89a2 files · +195 −1Browse files

Showing the changes to include/uapi (1 of 2 files). Show all

Unified · Split

include/uapi/linux/ublk_cmd.h+5−0
@@ -103,6 +103,11 @@ · 102 unmodified lines
103103 _IOWR('u', 0x23, struct ublksrv_io_cmd)
104104 #define UBLK_U_IO_UNREGISTER_IO_BUF \
105105 _IOWR('u', 0x24, struct ublksrv_io_cmd)
106+
107+/*
108+ * return 0 if the command is run successfully, otherwise failure code
109+ * is returned
110+ */
106111 #define UBLK_U_IO_PREP_IO_CMDS \
107112 _IOWR('u', 0x25, struct ublk_batch_io)
108113 #define UBLK_U_IO_COMMIT_IO_CMDS \