Skip to content

Commit f3156df

Browse files
adam900710kdave
authored andcommitted
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 <[email protected]> Signed-off-by: David Sterba <[email protected]>
1 parent 35b6ddf commit f3156df

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

fs/btrfs/extent_io.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3967,7 +3967,13 @@ static noinline_for_stack int lock_extent_buffer_for_io(struct extent_buffer *eb
39673967

39683968
btrfs_tree_unlock(eb);
39693969

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

39733979
num_pages = num_extent_pages(eb);

0 commit comments

Comments
 (0)