Re: [PATCH 2/2] zloop: use blk_rq_nr_phys_segments() instead of iterating bvecs

From: Christoph Hellwig

Date: Tue Nov 11 2025 - 04:12:53 EST


On Sat, Nov 08, 2025 at 04:01:01PM -0700, Caleb Sander Mateos wrote:
> The number of bvecs can be obtained directly from struct request's
> nr_phys_segments field via blk_rq_nr_phys_segments(), so use that
> instead of iterating over the bvecs an extra time.

Same reason this doesn't work as Ming explained for ublk.

Maybe we should lift this code from loop/zloop into a well documented
common helper to make it more obvious?