btrfs: raid56: reduce overhead to calculate the bio length
authorQu Wenruo <wqu@suse.com>
Sat, 21 Jan 2023 08:06:12 +0000 (16:06 +0800)
committerDavid Sterba <dsterba@suse.com>
Wed, 15 Feb 2023 18:38:50 +0000 (19:38 +0100)
commitc9a43aaf0971660e388b794feb0db4649746390a
tree311009d109ae3d86fe54d411a2652b3195d212e9
parent67da05b3f28166b24316ecf675637f9b77661983
btrfs: raid56: reduce overhead to calculate the bio length

In rbio_update_error_bitmap(), we need to calculate the length of the
rbio.  As since it's called in the endio function, we can not directly
grab the length from bi_iter.

Currently we call bio_for_each_segment_all(), which will always return a
range inside a page.  But that's not necessary as we don't really care
about anything inside the page.

So use bio_for_each_bvec_all(), which can return a bvec across multiple
continuous pages thus reduce the loops.

Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Qu Wenruo <wqu@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/raid56.c