btrfs: move the compress_type check out of btrfs_bio_add_page
authorChristoph Hellwig <hch@lst.de>
Mon, 27 Feb 2023 15:16:58 +0000 (08:16 -0700)
committerDavid Sterba <dsterba@suse.com>
Mon, 17 Apr 2023 16:01:15 +0000 (18:01 +0200)
commitc9bc621fb4988d5e1bd96d552bb3fda199638864
treef158d365c6f6c2b67c9d61b671dbacbd9f293084
parent72b505dc57573e1026bc9b8178a5e36804f339b8
btrfs: move the compress_type check out of btrfs_bio_add_page

The compress_type can only change on a per-extent basis.  So instead of
checking it for every page in btrfs_bio_add_page, do the check once in
btrfs_do_readpage, which is the only caller of btrfs_bio_add_page and
submit_extent_page that deals with compressed extents.

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