drivers/block/ublk_drv.c | 123 +++++++++++++++++++-------------------- 1 file changed, 60 insertions(+), 63 deletions(-)
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. ublk_setup_iod_zoned()
duplicates the code for initializing struct ublksrv_io_desc, making it
easy to forget to keep them in sync. Move the common code to a helper
function ublk_init_iod(). This allows zone appends to leverage the
shared memory zero copy optimization.
This series is based on "ublk: optimize ublk_rq_has_data()" [1]
[1]: https://lore.kernel.org/linux-block/20260513211846.1956810-1-csander@purestorage.com/
Caleb Sander Mateos (2):
ublk: move ublk_req_build_flags() earlier
ublk: factor out ublk_init_iod() helper
drivers/block/ublk_drv.c | 123 +++++++++++++++++++--------------------
1 file changed, 60 insertions(+), 63 deletions(-)
--
2.54.0
On Wed, 20 May 2026 14:36:52 -0600, Caleb Sander Mateos wrote:
> 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. ublk_setup_iod_zoned()
> duplicates the code for initializing struct ublksrv_io_desc, making it
> easy to forget to keep them in sync. Move the common code to a helper
> function ublk_init_iod(). This allows zone appends to leverage the
> shared memory zero copy optimization.
>
> [...]
Applied, thanks!
[1/2] ublk: move ublk_req_build_flags() earlier
commit: eee9224affae6c1bfd664e5b769e40e3ff099879
[2/2] ublk: factor out ublk_init_iod() helper
commit: 23130b3ffcdb1568a9ef178ab3cba866e5486082
Best regards,
--
Jens Axboe
On Wed, May 20, 2026 at 02:36:52PM -0600, Caleb Sander Mateos wrote:
> 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. ublk_setup_iod_zoned()
> duplicates the code for initializing struct ublksrv_io_desc, making it
> easy to forget to keep them in sync. Move the common code to a helper
> function ublk_init_iod(). This allows zone appends to leverage the
> shared memory zero copy optimization.
>
> This series is based on "ublk: optimize ublk_rq_has_data()" [1]
>
> [1]: https://lore.kernel.org/linux-block/20260513211846.1956810-1-csander@purestorage.com/
Looks fine, it just allows the optimization for zone append.
Reviewed-by: Ming Lei <tom.leiming@gmail.com>
Thanks,
Ming
© 2016 - 2026 Red Hat, Inc.