]> www.infradead.org Git - users/jedix/linux-maple.git/commit
btrfs: prepare btrfs_buffered_write() for large data folios
authorQu Wenruo <wqu@suse.com>
Wed, 26 Mar 2025 02:54:21 +0000 (13:24 +1030)
committerDavid Sterba <dsterba@suse.com>
Thu, 15 May 2025 12:30:40 +0000 (14:30 +0200)
commitbe8ef7990c6775c2bb1374abbde8f5408c527eba
tree02fc7adec8d89c8c5dbad83c3da2bd1b4fcb35c3
parent581bb9e761f93df37c40ff8e6904796aa6d8aa41
btrfs: prepare btrfs_buffered_write() for large data folios

This involves the following modifications:

- Set the order flags for __filemap_get_folio() inside
  prepare_one_folio()

  This will allow __filemap_get_folio() to create a large folio if the
  address space supports it.

- Limit the initial @write_bytes inside copy_one_range()
  If the largest folio boundary splits the initial write range, there is
  no way we can write beyond the largest folio boundary.

  This is done by a simple helper calc_write_bytes().

- Release exceeding reserved space if the folio is smaller than expected
  Which is doing the same handling when short copy happens.

All the preparations should not change the behavior when the largest
folio order is 0.

Reviewed-by: Filipe Manana <fdmanana@suse.com>
Signed-off-by: Qu Wenruo <wqu@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/file.c