btrfs: only call __extent_writepage_io from extent_write_locked_range
authorChristoph Hellwig <hch@lst.de>
Wed, 31 May 2023 06:05:01 +0000 (08:05 +0200)
committerDavid Sterba <dsterba@suse.com>
Mon, 19 Jun 2023 11:59:35 +0000 (13:59 +0200)
commiteb34dceace983e304e00d4bf711cec0a603959ac
treed14415196c37b086f2e93a6b840ed8eb011d2521
parent9ecdbee819ca90589bf2efccfb90d5dabc0de057
btrfs: only call __extent_writepage_io from extent_write_locked_range

__extent_writepage does a lot of things that make no sense for
extent_write_locked_range, given that extent_write_locked_range itself is
called from __extent_writepage either directly or through a workqueue,
and all this work has already been done in the first invocation and the
pages haven't been unlocked since.  Call __extent_writepage_io directly
instead and open code the logic tracked in
btrfs_bio_ctrl::extent_locked.

Reviewed-by: Josef Bacik <josef@toxicpanda.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