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.
Showing the changes to include/uapi (1 of 2 files). Show all
Unified · Split
| @@ -103,6 +103,11 @@ · 102 unmodified lines | |||
| 103 | _IOWR('u', 0x23, struct ublksrv_io_cmd) | 103 | _IOWR('u', 0x23, struct ublksrv_io_cmd) |
| 104 | #define UBLK_U_IO_UNREGISTER_IO_BUF \ | 104 | #define UBLK_U_IO_UNREGISTER_IO_BUF \ |
| 105 | _IOWR('u', 0x24, struct ublksrv_io_cmd) | 105 | _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 | */ | ||
| 106 | #define UBLK_U_IO_PREP_IO_CMDS \ | 111 | #define UBLK_U_IO_PREP_IO_CMDS \ |
| 107 | _IOWR('u', 0x25, struct ublk_batch_io) | 112 | _IOWR('u', 0x25, struct ublk_batch_io) |
| 108 | #define UBLK_U_IO_COMMIT_IO_CMDS \ | 113 | #define UBLK_U_IO_COMMIT_IO_CMDS \ |