btrfs-progs: check: cleanup use of fs_info in check_fs_roots
authorDavid Sterba <dsterba@suse.com>
Wed, 30 Aug 2017 17:52:44 +0000 (19:52 +0200)
committerDavid Sterba <dsterba@suse.com>
Fri, 8 Sep 2017 14:15:05 +0000 (16:15 +0200)
Signed-off-by: David Sterba <dsterba@suse.com>
cmds-check.c

index 6911064..39598b5 100644 (file)
@@ -4057,9 +4057,8 @@ static int check_fs_roots(struct btrfs_fs_info *fs_info,
        struct btrfs_key key;
        struct walk_control wc;
        struct extent_buffer *leaf, *tree_node;
-       struct btrfs_root *root = fs_info->fs_root;
        struct btrfs_root *tmp_root;
-       struct btrfs_root *tree_root = root->fs_info->tree_root;
+       struct btrfs_root *tree_root = fs_info->tree_root;
        int ret;
        int err = 0;
 
@@ -4073,7 +4072,7 @@ static int check_fs_roots(struct btrfs_fs_info *fs_info,
         * reflected into the free space cache yet.
         */
        if (repair)
-               reset_cached_block_groups(root->fs_info);
+               reset_cached_block_groups(fs_info);
        memset(&wc, 0, sizeof(wc));
        cache_tree_init(&wc.shared);
        btrfs_init_path(&path);
@@ -4109,11 +4108,11 @@ again:
                    fs_root_objectid(key.objectid)) {
                        if (key.objectid == BTRFS_TREE_RELOC_OBJECTID) {
                                tmp_root = btrfs_read_fs_root_no_cache(
-                                               root->fs_info, &key);
+                                               fs_info, &key);
                        } else {
                                key.offset = (u64)-1;
                                tmp_root = btrfs_read_fs_root(
-                                               root->fs_info, &key);
+                                               fs_info, &key);
                        }
                        if (IS_ERR(tmp_root)) {
                                err = 1;