ublk: use rq_for_each_segment() for user copy
authorCaleb Sander Mateos <csander@purestorage.com>
Thu, 6 Nov 2025 17:16:47 +0000 (10:16 -0700)
committerJens Axboe <axboe@kernel.dk>
Thu, 6 Nov 2025 23:26:04 +0000 (16:26 -0700)
commite87d66ab27ac89494b75ddc3fed697b5aa8417f1
treef0760981a0df93743e4d95196dc7047cae1896f9
parent2299ceec364eecdc0a5b4ec80c757551d130389c
ublk: use rq_for_each_segment() for user copy

ublk_advance_io_iter() and ublk_copy_io_pages() currently open-code the
iteration over the request's bvecs. Switch to the rq_for_each_segment()
macro provided by blk-mq to avoid reaching into the bio internals and
simplify the code.

Suggested-by: Ming Lei <ming.lei@redhat.com>
Signed-off-by: Caleb Sander Mateos <csander@purestorage.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
drivers/block/ublk_drv.c