Re: [PATCH 03/42] btrfs: make lock_extent_buffer_for_io() to be subpage compatible

2021-04-15 Thread Josef Bacik

On 4/15/21 1:04 AM, Qu Wenruo wrote:

For subpage metadata, we don't use page locking at all.
So just skip the page locking part for subpage.

All the remaining routine can be reused.

Signed-off-by: Qu Wenruo 


Reviewed-by: Josef Bacik 

Thanks,

Josef


[PATCH 03/42] btrfs: make lock_extent_buffer_for_io() to be subpage compatible

2021-04-14 Thread Qu Wenruo
For subpage metadata, we don't use page locking at all.
So just skip the page locking part for subpage.

All the remaining routine can be reused.

Signed-off-by: Qu Wenruo 
---
 fs/btrfs/extent_io.c | 8 +++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/fs/btrfs/extent_io.c b/fs/btrfs/extent_io.c
index f32163a465ec..c068c2fcba09 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.
+* 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);
-- 
2.31.1