btrfs: get mapping tree directly from fsinfo in find_first_block_group
authorJohannes Thumshirn <johannes.thumshirn@wdc.com>
Tue, 2 Jun 2020 10:05:56 +0000 (19:05 +0900)
committerDavid Sterba <dsterba@suse.com>
Mon, 27 Jul 2020 10:55:20 +0000 (12:55 +0200)
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.

Reviewed-by: Nikolay Borisov <nborisov@suse.com>
Signed-off-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/block-group.c

index e29e9629b246bf3e38c36c5741ca4637c0a5cc89..bfb5f42583363cfa62bae5c462e46b18248b77c6 100644 (file)
@@ -1566,7 +1566,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);