summaryrefslogtreecommitdiff
path: root/fs/btrfs/extent_io.c
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2023-05-03 18:24:29 +0300
committerDavid Sterba <dsterba@suse.com>2023-06-19 14:59:27 +0300
commit3d66b4b27d2b7f5e74071256acea38108f9dbeb5 (patch)
treef66cff44e95455f73258e11b493baa8bf080e357 /fs/btrfs/extent_io.c
parent046b562b20a5cfe205fb78c6f8a1a8b74f01d303 (diff)
downloadlinux-3d66b4b27d2b7f5e74071256acea38108f9dbeb5.tar.xz
btrfs: do not try to unlock the extent for non-subpage metadata reads
Only subpage metadata reads lock the extent. Don't try to unlock it and waste cycles in the extent tree lookup for PAGE_SIZE or larger metadata. Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com> Reviewed-by: Josef Bacik <josef@toxicpanda.com> Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'fs/btrfs/extent_io.c')
-rw-r--r--fs/btrfs/extent_io.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/fs/btrfs/extent_io.c b/fs/btrfs/extent_io.c
index 4581ee5a0835..e35dfae57e50 100644
--- a/fs/btrfs/extent_io.c
+++ b/fs/btrfs/extent_io.c
@@ -4208,8 +4208,10 @@ static void extent_buffer_read_end_io(struct btrfs_bio *bbio)
bio_offset += bvec->bv_len;
}
- unlock_extent(&bbio->inode->io_tree, eb->start,
- eb->start + bio_offset - 1, NULL);
+ if (eb->fs_info->nodesize < PAGE_SIZE) {
+ unlock_extent(&bbio->inode->io_tree, eb->start,
+ eb->start + bio_offset - 1, NULL);
+ }
free_extent_buffer(eb);
bio_put(&bbio->bio);