btrfs: make buffered write to copy one page a time
authorQu Wenruo <wqu@suse.com>
Thu, 10 Oct 2024 04:46:12 +0000 (15:16 +1030)
committerDavid Sterba <dsterba@suse.com>
Mon, 11 Nov 2024 13:34:19 +0000 (14:34 +0100)
commitc87c299776e4d75bcc5559203ae2c37dc0396d80
treeeea982d95ceb48047011838e598e3c3a7818fc3a
parentb1c5f6eda2d024c187d4d47f0310bc5a1cc8b1d3
btrfs: make buffered write to copy one page a time

Currently the btrfs_buffered_write() is preparing multiple page a time,
allowing a better performance.

But the current trend is to support larger folio as an optimization,
instead of implementing own multi-page optimization.

This is inspired by generic_perform_write(), which is copying one folio
a time.

Such change will prepare us to migrate to implement the write_begin()
and write_end() callbacks, and make every involved function a little
easier.

Signed-off-by: Qu Wenruo <wqu@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/file.c
fs/btrfs/file.h
fs/btrfs/free-space-cache.c