aboutsummaryrefslogtreecommitdiffstats
path: root/fs/btrfs/compression.c
diff options
context:
space:
mode:
authorJohannes Thumshirn <[email protected]>2024-08-13 11:36:40 +0000
committerDavid Sterba <[email protected]>2024-09-10 14:51:18 +0000
commit0ae653fbec2b9fbc72c65a0c99528990bfb2136d (patch)
tree30caf7c7d1bd5567f80636972bd551903bd9b797 /fs/btrfs/compression.c
parentbtrfs: directly wake up cleaner kthread in the BTRFS_IOC_SYNC ioctl (diff)
downloadkernel-0ae653fbec2b9fbc72c65a0c99528990bfb2136d.tar.gz
kernel-0ae653fbec2b9fbc72c65a0c99528990bfb2136d.zip
btrfs: reduce chunk_map lookups in btrfs_map_block()
Currently we're calling btrfs_num_copies() before btrfs_get_chunk_map() in btrfs_map_block(). But btrfs_num_copies() itself does a chunk map lookup to be able to calculate the number of copies. So split out the code getting the number of copies from btrfs_num_copies() into a helper called btrfs_chunk_map_num_copies() and directly call it from btrfs_map_block() and btrfs_num_copies(). This saves us one rbtree lookup per btrfs_map_block() invocation. Reviewed-by: Qu Wenruo <[email protected]> Reviewed-by: Filipe Manana <[email protected]> Signed-off-by: Johannes Thumshirn <[email protected]> Reviewed-by: David Sterba <[email protected]> Signed-off-by: David Sterba <[email protected]>
Diffstat (limited to 'fs/btrfs/compression.c')
0 files changed, 0 insertions, 0 deletions