Message ID | 20200526142124.36202-3-johannes.thumshirn@wdc.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | 3 small cleanups for find_first_block_group | expand |
On 26.05.20 г. 17:21 ч., Johannes Thumshirn wrote: > We already have an fs_info in our function parameters, there's no need to > do the maths again and get fs_info from the extent_root just to get the > mapping_tree. > > Instead directly grab the mapping_tree from fs_info. > > Signed-off-by: Johannes Thumshirn <johannes.thumshirn@wdc.com> Reviewed-by: Nikolay Borisov <nborisov@suse.com>
diff --git a/fs/btrfs/block-group.c b/fs/btrfs/block-group.c index c5acd89c864c..c4462e4c8413 100644 --- a/fs/btrfs/block-group.c +++ b/fs/btrfs/block-group.c @@ -1556,7 +1556,7 @@ static int find_first_block_group(struct btrfs_fs_info *fs_info, struct extent_map_tree *em_tree; struct extent_map *em; - em_tree = &root->fs_info->mapping_tree; + em_tree = &fs_info->mapping_tree; read_lock(&em_tree->lock); em = lookup_extent_mapping(em_tree, found_key.objectid, found_key.offset);
We already have an fs_info in our function parameters, there's no need to do the maths again and get fs_info from the extent_root just to get the mapping_tree. Instead directly grab the mapping_tree from fs_info. Signed-off-by: Johannes Thumshirn <johannes.thumshirn@wdc.com> --- fs/btrfs/block-group.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)