diff options
author | David Sterba <dsterba@suse.com> | 2017-08-30 19:41:15 +0200 |
---|---|---|
committer | David Sterba <dsterba@suse.com> | 2017-09-08 16:15:05 +0200 |
commit | 7e9a270a1252eb6b46e55e0dfd3849fe75e4237c (patch) | |
tree | 7977b512dc26fa1ebe630b47a352392d7ee52a30 /cmds-check.c | |
parent | 7349edaf28bc3785057e9932c005137fffd9b2d4 (diff) |
btrfs-progs: check: use local fs_info in check_chunks_and_extents
Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'cmds-check.c')
-rw-r--r-- | cmds-check.c | 27 |
1 files changed, 13 insertions, 14 deletions
diff --git a/cmds-check.c b/cmds-check.c index 2c65c5bc..d0779e6e 100644 --- a/cmds-check.c +++ b/cmds-check.c @@ -9876,10 +9876,10 @@ static int check_chunks_and_extents(struct btrfs_fs_info *fs_info) INIT_LIST_HEAD(&normal_trees); if (repair) { - root->fs_info->excluded_extents = &excluded_extents; - root->fs_info->fsck_extent_cache = &extent_cache; - root->fs_info->free_extent_hook = free_extent_hook; - root->fs_info->corrupt_blocks = &corrupt_blocks; + fs_info->excluded_extents = &excluded_extents; + fs_info->fsck_extent_cache = &extent_cache; + fs_info->free_extent_hook = free_extent_hook; + fs_info->corrupt_blocks = &corrupt_blocks; } bits_nr = 1024; @@ -9895,13 +9895,13 @@ static int check_chunks_and_extents(struct btrfs_fs_info *fs_info) } again: - root1 = root->fs_info->tree_root; + root1 = fs_info->tree_root; level = btrfs_header_level(root1->node); ret = add_root_item_to_list(&normal_trees, root1->root_key.objectid, root1->node->start, 0, level, 0, NULL); if (ret < 0) goto out; - root1 = root->fs_info->chunk_root; + root1 = fs_info->chunk_root; level = btrfs_header_level(root1->node); ret = add_root_item_to_list(&normal_trees, root1->root_key.objectid, root1->node->start, 0, level, 0, NULL); @@ -9911,8 +9911,7 @@ again: key.offset = 0; key.objectid = 0; key.type = BTRFS_ROOT_ITEM_KEY; - ret = btrfs_search_slot(NULL, root->fs_info->tree_root, - &key, &path, 0, 0); + ret = btrfs_search_slot(NULL, fs_info->tree_root, &key, &path, 0, 0); if (ret < 0) goto out; while(1) { @@ -10006,12 +10005,12 @@ again: out: task_stop(ctx.info); if (repair) { - free_corrupt_blocks_tree(root->fs_info->corrupt_blocks); + free_corrupt_blocks_tree(fs_info->corrupt_blocks); extent_io_tree_cleanup(&excluded_extents); - root->fs_info->fsck_extent_cache = NULL; - root->fs_info->free_extent_hook = NULL; - root->fs_info->corrupt_blocks = NULL; - root->fs_info->excluded_extents = NULL; + fs_info->fsck_extent_cache = NULL; + fs_info->free_extent_hook = NULL; + fs_info->corrupt_blocks = NULL; + fs_info->excluded_extents = NULL; } free(bits); free_chunk_cache_tree(&chunk_cache); @@ -10026,7 +10025,7 @@ out: free_root_item_list(&dropping_trees); return ret; loop: - free_corrupt_blocks_tree(root->fs_info->corrupt_blocks); + free_corrupt_blocks_tree(fs_info->corrupt_blocks); free_extent_cache_tree(&seen); free_extent_cache_tree(&pending); free_extent_cache_tree(&reada); |