diff options
author | Qu Wenruo | 2021-04-06 08:36:02 +0800 |
---|---|---|
committer | David Sterba | 2021-04-19 17:25:22 +0200 |
commit | f3156df944754d9984b1595994caa1c93b8cae3b (patch) | |
tree | 5200af4cf8dce6cead47905b7bd3d3a15405ff99 /fs/btrfs | |
parent | 35b6ddfa9626d1461d54eb203e9b6021d97dd13c (diff) |
btrfs: make lock_extent_buffer_for_io() to be subpage compatible
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>
Diffstat (limited to 'fs/btrfs')
-rw-r--r-- | fs/btrfs/extent_io.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/fs/btrfs/extent_io.c b/fs/btrfs/extent_io.c index e0713b0753b7..396ba23cfd4d 100644 --- a/fs/btrfs/extent_io.c +++ b/fs/btrfs/extent_io.c @@ -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); |