btrfs-progs: check: pass fs_info to check_chunks_and_extents_v2
authorDavid Sterba <dsterba@suse.com>
Wed, 30 Aug 2017 17:38:02 +0000 (19:38 +0200)
committerDavid Sterba <dsterba@suse.com>
Fri, 8 Sep 2017 14:15:05 +0000 (16:15 +0200)
The root pointer is set to fs_root as was originally.

Signed-off-by: David Sterba <dsterba@suse.com>
cmds-check.c

index d0779e6..7dd6a0b 100644 (file)
@@ -11503,15 +11503,18 @@ static int traverse_tree_block(struct btrfs_root *root,
 /*
  * Low memory usage version check_chunks_and_extents.
  */
-static int check_chunks_and_extents_v2(struct btrfs_root *root)
+static int check_chunks_and_extents_v2(struct btrfs_fs_info *fs_info)
 {
        struct btrfs_path path;
        struct btrfs_key key;
        struct btrfs_root *root1;
+       struct btrfs_root *root;
        struct btrfs_root *cur_root;
        int err = 0;
        int ret;
 
+       root = fs_info->fs_root;
+
        root1 = root->fs_info->chunk_root;
        ret = traverse_tree_block(root1, root1->node);
        err |= ret;
@@ -13026,7 +13029,7 @@ int cmd_check(int argc, char **argv)
        if (!ctx.progress_enabled)
                fprintf(stderr, "checking extents\n");
        if (check_mode == CHECK_MODE_LOWMEM)
-               ret = check_chunks_and_extents_v2(root);
+               ret = check_chunks_and_extents_v2(info);
        else
                ret = check_chunks_and_extents(info);
        err |= !!ret;