btrfs: move page locking from lock_extent_buffer_for_io to write_one_eb
authorChristoph Hellwig <hch@lst.de>
Wed, 3 May 2023 15:24:32 +0000 (17:24 +0200)
committerDavid Sterba <dsterba@suse.com>
Mon, 19 Jun 2023 11:59:28 +0000 (13:59 +0200)
commit81a79b6ae4519a97c5924d68e1fb77d283cb051d
tree7dbbebc2d23afcc280f144a3db873f3c355b7fbe
parent50b21d7a066f9a702b1d54ca11fc577302e875cb
btrfs: move page locking from lock_extent_buffer_for_io to write_one_eb

Locking the pages in lock_extent_buffer_for_io only for the non-subpage
case is very confusing.  Move it to write_one_eb to mirror the subpage
case and simplify the code. Now lock_extent_buffer_for_io does not leave
all the pages locked and each is individually locked/unlocked in
write_one_eb.

Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
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