Skip to content

Commit

Permalink
btrfs: make lock_extent_buffer_for_io() to be subpage compatible
Browse files Browse the repository at this point in the history
For subpage metadata, we don't use page locking at all.  So just skip
the page locking part for subpage.  The rest of the function can be
reused.

Signed-off-by: Qu Wenruo <wqu@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
  • Loading branch information
Qu Wenruo authored and David Sterba committed Apr 19, 2021
1 parent 35b6ddf commit f3156df
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion fs/btrfs/extent_io.c
Original file line number Diff line number Diff line change
Expand Up @@ -3967,7 +3967,13 @@ static noinline_for_stack int lock_extent_buffer_for_io(struct extent_buffer *eb

btrfs_tree_unlock(eb);

if (!ret)
/*
* Either we don't need to submit any tree block, or we're submitting
* subpage eb.
* Subpage metadata doesn't use page locking at all, so we can skip
* the page locking.
*/
if (!ret || fs_info->sectorsize < PAGE_SIZE)
return ret;

num_pages = num_extent_pages(eb);
Expand Down

0 comments on commit f3156df

Please sign in to comment.