Skip to content

btrfs: refactor btrfs_buffered_write() for the incoming large data folios

Qu Wenruo linux-btrfs 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest4 patches 14 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/4btrfs: remove force_page_uptodate variable from btrfs_buffered_write()fs/btrfs/file.c+6 -133 replies
2/4btrfs: cleanup the reserved space inside the loop of btrfs_buffered_write()fs/btrfs/file.c+31 -162 replies
3/4btrfs: extract the space reservation code from btrfs_buffered_write()fs/btrfs/file.c+63 -452 replies
4/4btrfs: extract the main loop of btrfs_buffered_write() into a helperfs/btrfs/file.c+147 -1453 replies

Reviews trailers per patch

All 4 patches have a Reviewed-by or Acked-by.

PatchJohannes ThumshirnFilipe Manana
1/4R-b R-b
2/4R-b R-b
3/4R-b R-b
4/4R-b R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [PATCH 0/4] btrfs: refactor btrfs_buffered_write() for the incoming large data folios

The function btrfs_buffered_write() is implementing all the complex heavy-lifting work inside a huge while () loop, which makes later large data folios work much harder.

The first patch is a patch that already submitted to the mailing list recently, but all later reworks depends on that patch, thus it is included in the series.

The core of the whole series is to introduce a helper function, copy_one_range() to do the buffer copy into one single folio.

Patch 2 is a preparation that moves the error cleanup into the main loop, so we do not have dedicated out-of-loop cleanup.

Patch 3 is another preparation that extract the space reservation code into a helper, make the final refactor patch a little more smaller.

And patch 4 is the main dish, with all the refactoring happening inside it.

Qu Wenruo (4):
btrfs: remove force_page_uptodate variable from btrfs_buffered_write()
btrfs: cleanup the reserved space inside the loop of
btrfs_buffered_write()
btrfs: extract the space reservation code from btrfs_buffered_write()
btrfs: extract the main loop of btrfs_buffered_write() into a helper

 fs/btrfs/file.c | 434 ++++++++++++++++++++++++++----------------------
 1 file changed, 231 insertions(+), 203 deletions(-)
Signature · 1 line
2.49.0