]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
ublk: factor out ublk_init_iod() helper
authorCaleb Sander Mateos <csander@purestorage.com>
Wed, 20 May 2026 20:36:54 +0000 (14:36 -0600)
committerJens Axboe <axboe@kernel.dk>
Fri, 22 May 2026 14:05:36 +0000 (08:05 -0600)
commit23130b3ffcdb1568a9ef178ab3cba866e5486082
tree1cebfb69ade55e6062f307b8a98f285669b721d0
parenteee9224affae6c1bfd664e5b769e40e3ff099879
ublk: factor out ublk_init_iod() helper

The code for initializing struct ublksrv_io_desc on I/O dispatch is
largely duplicated in 3 places. Commit 4d4a512a1f87 ("ublk: add PFN-
based buffer matching in I/O path") added support to ublk_setup_iod()
for matching request buffers against registered UBLK_F_SHMEM_ZC buffers,
but missed adding it to ublk_setup_iod_zoned() for zoned requests. Move
the duplicated logic to a new helper ublk_init_iod(). This way, zone
appends can also benefit from avoiding the data copy.

Signed-off-by: Caleb Sander Mateos <csander@purestorage.com>
Reviewed-by: Ming Lei <tom.leiming@gmail.com>
Link: https://patch.msgid.link/20260520203654.1413640-3-csander@purestorage.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
drivers/block/ublk_drv.c