btrfs: copy all pages at once at the end of btrfs_clone_extent_buffer()
authorQu Wenruo <wqu@suse.com>
Sat, 15 Jul 2023 11:08:32 +0000 (19:08 +0800)
committerDavid Sterba <dsterba@suse.com>
Mon, 21 Aug 2023 12:52:17 +0000 (14:52 +0200)
commit682a0bc5573f3c10a435fb9650c856bb325d2733
tree361469ca2e9627dbd08e1366f342b109d1fd8776
parent54948681c21171a67c2fe03adcce54901e39dfe3
btrfs: copy all pages at once at the end of btrfs_clone_extent_buffer()

btrfs_clone_extent_buffer() calls copy_page() at each iteration but we
can copy all pages at the end in one go if there were no errors.
This would make later conversion to folios easier.

Reviewed-by: Sweet Tea Dorminy <sweettea-kernel@dorminy.me>
Signed-off-by: Qu Wenruo <wqu@suse.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/extent_io.c