btrfs: check for contiguity in submit_extent_page
authorChristoph Hellwig <hch@lst.de>
Mon, 27 Feb 2023 15:17:03 +0000 (08:17 -0700)
committerDavid Sterba <dsterba@suse.com>
Mon, 17 Apr 2023 16:01:16 +0000 (18:01 +0200)
commit78a2ef1b7b332caaf6466be0b2608082e7c9e7ea
tree8ee7b801b40afc08d48c1a1f3127b14aabe3ff75
parent5380311fc8b7baa45011a9b45193b8ba11fc0efb
btrfs: check for contiguity in submit_extent_page

Different loop iterations in btrfs_bio_add_page not only have the same
contiguity parameters, but also any non-initial operation operates on a
fresh bio anyway.

Factor out the contiguity check into a new btrfs_bio_is_contig and only
call it once in submit_extent_page before descending into the
bio_add_page loop.

Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/extent_io.c