mirror of
https://github.com/kdave/btrfs-progs
synced 2025-02-26 23:10:50 +00:00
btrfs-progs: drop open_ctree_flags variable in cmd_inspect_dump_tree
Local variable open_ctree_flags carries the flags whose final update is for the locally declared struct variable oca_flags. Just use oca.flags directly. Reviewed-by: David Sterba <dsterba@suse.com> Signed-off-by: Anand Jain <anand.jain@oracle.com> Signed-off-by: David Sterba <dsterba@suse.com>
This commit is contained in:
parent
d46a0ef6a0
commit
dc9e80192b
@ -328,7 +328,6 @@ static int cmd_inspect_dump_tree(const struct cmd_struct *cmd,
|
|||||||
bool root_backups = false;
|
bool root_backups = false;
|
||||||
int traverse = BTRFS_PRINT_TREE_DEFAULT;
|
int traverse = BTRFS_PRINT_TREE_DEFAULT;
|
||||||
int dev_optind;
|
int dev_optind;
|
||||||
unsigned open_ctree_flags;
|
|
||||||
u64 block_bytenr;
|
u64 block_bytenr;
|
||||||
struct btrfs_root *tree_root_scan;
|
struct btrfs_root *tree_root_scan;
|
||||||
u64 tree_id = 0;
|
u64 tree_id = 0;
|
||||||
@ -346,7 +345,7 @@ static int cmd_inspect_dump_tree(const struct cmd_struct *cmd,
|
|||||||
* And we want to avoid tree-checker, which can rejects the target tree
|
* And we want to avoid tree-checker, which can rejects the target tree
|
||||||
* block completely, while we may be debugging the problem.
|
* block completely, while we may be debugging the problem.
|
||||||
*/
|
*/
|
||||||
open_ctree_flags = OPEN_CTREE_PARTIAL | OPEN_CTREE_NO_BLOCK_GROUPS |
|
oca.flags = OPEN_CTREE_PARTIAL | OPEN_CTREE_NO_BLOCK_GROUPS |
|
||||||
OPEN_CTREE_SKIP_LEAF_ITEM_CHECKS;
|
OPEN_CTREE_SKIP_LEAF_ITEM_CHECKS;
|
||||||
cache_tree_init(&block_root);
|
cache_tree_init(&block_root);
|
||||||
optind = 0;
|
optind = 0;
|
||||||
@ -400,7 +399,7 @@ static int cmd_inspect_dump_tree(const struct cmd_struct *cmd,
|
|||||||
* If only showing one block, no need to fill roots
|
* If only showing one block, no need to fill roots
|
||||||
* other than chunk root
|
* other than chunk root
|
||||||
*/
|
*/
|
||||||
open_ctree_flags |= __OPEN_CTREE_RETURN_CHUNK_ROOT;
|
oca.flags |= __OPEN_CTREE_RETURN_CHUNK_ROOT;
|
||||||
block_bytenr = arg_strtou64(optarg);
|
block_bytenr = arg_strtou64(optarg);
|
||||||
ret = dump_add_tree_block(&block_root, block_bytenr);
|
ret = dump_add_tree_block(&block_root, block_bytenr);
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
@ -437,10 +436,10 @@ static int cmd_inspect_dump_tree(const struct cmd_struct *cmd,
|
|||||||
traverse = BTRFS_PRINT_TREE_BFS;
|
traverse = BTRFS_PRINT_TREE_BFS;
|
||||||
break;
|
break;
|
||||||
case GETOPT_VAL_NOSCAN:
|
case GETOPT_VAL_NOSCAN:
|
||||||
open_ctree_flags |= OPEN_CTREE_NO_DEVICES;
|
oca.flags |= OPEN_CTREE_NO_DEVICES;
|
||||||
break;
|
break;
|
||||||
case GETOPT_VAL_HIDE_NAMES:
|
case GETOPT_VAL_HIDE_NAMES:
|
||||||
open_ctree_flags |= OPEN_CTREE_HIDE_NAMES;
|
oca.flags |= OPEN_CTREE_HIDE_NAMES;
|
||||||
break;
|
break;
|
||||||
case GETOPT_VAL_CSUM_HEADERS:
|
case GETOPT_VAL_CSUM_HEADERS:
|
||||||
csum_mode |= BTRFS_PRINT_TREE_CSUM_HEADERS;
|
csum_mode |= BTRFS_PRINT_TREE_CSUM_HEADERS;
|
||||||
@ -493,7 +492,6 @@ static int cmd_inspect_dump_tree(const struct cmd_struct *cmd,
|
|||||||
pr_verbose(LOG_DEFAULT, "%s\n", PACKAGE_STRING);
|
pr_verbose(LOG_DEFAULT, "%s\n", PACKAGE_STRING);
|
||||||
|
|
||||||
oca.filename = argv[optind];
|
oca.filename = argv[optind];
|
||||||
oca.flags = open_ctree_flags;
|
|
||||||
info = open_ctree_fs_info(&oca);
|
info = open_ctree_fs_info(&oca);
|
||||||
if (!info) {
|
if (!info) {
|
||||||
error("unable to open %s", argv[optind]);
|
error("unable to open %s", argv[optind]);
|
||||||
|
Loading…
Reference in New Issue
Block a user