]> www.infradead.org Git - users/jedix/linux-maple.git/commit
btrfs: introduce write_one_subpage_eb() function
authorQu Wenruo <wqu@suse.com>
Tue, 6 Apr 2021 00:36:01 +0000 (08:36 +0800)
committerDavid Sterba <dsterba@suse.com>
Tue, 6 Apr 2021 15:44:18 +0000 (17:44 +0200)
commite3a2bd0975a363afef87656cfeae61b559770879
tree4f4ea39b7d16ea3290e5fe0f1a283f7e8b836be0
parent7d05a72d5ae6c1dbb746d770a305e32977285e8a
btrfs: introduce write_one_subpage_eb() function

The new function, write_one_subpage_eb(), as a subroutine for subpage
metadata write, will handle the extent buffer bio submission.

The major differences between the new write_one_subpage_eb() and
write_one_eb() is:
- No page locking
  When entering write_one_subpage_eb() the page is no longer locked.
  We only lock the page for its status update, and unlock immediately.
  Now we completely rely on extent io tree locking.

- Extra bitmap update along with page status update
  Now page dirty and writeback is controlled by
  btrfs_subpage::dirty_bitmap and btrfs_subpage::writeback_bitmap.
  They both follow the schema that any sector is dirty/writeback, then
  the full page get dirty/writeback.

- When to update the nr_written number
  Now we take a short cut, if we have cleared the last dirty bit of the
  page, we update nr_written.
  This is not completely perfect, but should emulate the old behavior
  good enough.

Signed-off-by: Qu Wenruo <wqu@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/extent_io.c