]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
ublk: handle UBLK_U_IO_PREP_IO_CMDS
authorMing Lei <ming.lei@redhat.com>
Fri, 16 Jan 2026 14:18:37 +0000 (22:18 +0800)
committerJens Axboe <axboe@kernel.dk>
Fri, 23 Jan 2026 03:05:40 +0000 (20:05 -0700)
commitb256795b3606e9a67c725dde8eaae91dd9d21de4
treeb9f1b02d2392fd847ce10afe2735286889f7b078
parente86f89ab24f5ec595879a01eebb5df84f5ed6d2b
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>
drivers/block/ublk_drv.c
include/uapi/linux/ublk_cmd.h