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

The new function, end_bio_subpage_eb_writepage(), will handle the
metadata writeback endio.

The major differences involved are:
- How to grab extent buffer
  Now page::private is a pointer to btrfs_subpage, we can no longer grab
  extent buffer directly.
  Thus we need to use the bv_offset to locate the extent buffer manually
  and iterate through the whole range.

- Use btrfs_subpage_end_writeback() caller
  This helper will handle the subpage writeback for us.

Since this function is executed under endio context, when grabbing
extent buffers it can't grab eb->refs_lock as that lock is not designed
to be grabbed under hardirq context.

So here introduce a helper, find_extent_buffer_nospinlock(), for such
situation, and convert find_extent_buffer() to use that helper.

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