OSDN Git Service

btrfs: refactor main loop in copy_extent_buffer_full()
authorQu Wenruo <wqu@suse.com>
Sat, 15 Jul 2023 11:08:31 +0000 (19:08 +0800)
committerDavid Sterba <dsterba@suse.com>
Mon, 21 Aug 2023 12:52:17 +0000 (14:52 +0200)
commit54948681c21171a67c2fe03adcce54901e39dfe3
tree7ee2b8091cf16f69e96d754e45ccd4b8d2cc9312
parent730c374e5b2cec061e3af7616b9d1265e60b6c0a
btrfs: refactor main loop in copy_extent_buffer_full()

[BACKGROUND]
copy_extent_buffer_full() currently does different handling for regular
and subpage cases, for regular cases it does a page by page copying.
For subpage cases, it just copies the content.

This is fine for the page based extent buffer code, but for the incoming
folio conversion, it can be a burden to add a new branch just to handle
all the different combinations (subpage vs regular, one single folio vs
multi pages).

[ENHANCE]
Instead of handling the different combinations, just go one single
handling for all cases, utilizing write_extent_buffer() to do the
copying.

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