From dc9e80192bcd1861ac657c88ca70ae0afcbab1c9 Mon Sep 17 00:00:00 2001 From: Anand Jain Date: Tue, 13 Jun 2023 18:26:54 +0800 Subject: [PATCH] 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 Signed-off-by: Anand Jain Signed-off-by: David Sterba --- cmds/inspect-dump-tree.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/cmds/inspect-dump-tree.c b/cmds/inspect-dump-tree.c index 4c65f55d..9aa3cb45 100644 --- a/cmds/inspect-dump-tree.c +++ b/cmds/inspect-dump-tree.c @@ -328,7 +328,6 @@ static int cmd_inspect_dump_tree(const struct cmd_struct *cmd, bool root_backups = false; int traverse = BTRFS_PRINT_TREE_DEFAULT; int dev_optind; - unsigned open_ctree_flags; u64 block_bytenr; struct btrfs_root *tree_root_scan; u64 tree_id = 0; @@ -346,8 +345,8 @@ static int cmd_inspect_dump_tree(const struct cmd_struct *cmd, * And we want to avoid tree-checker, which can rejects the target tree * block completely, while we may be debugging the problem. */ - open_ctree_flags = OPEN_CTREE_PARTIAL | OPEN_CTREE_NO_BLOCK_GROUPS | - OPEN_CTREE_SKIP_LEAF_ITEM_CHECKS; + oca.flags = OPEN_CTREE_PARTIAL | OPEN_CTREE_NO_BLOCK_GROUPS | + OPEN_CTREE_SKIP_LEAF_ITEM_CHECKS; cache_tree_init(&block_root); optind = 0; while (1) { @@ -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 * other than chunk root */ - open_ctree_flags |= __OPEN_CTREE_RETURN_CHUNK_ROOT; + oca.flags |= __OPEN_CTREE_RETURN_CHUNK_ROOT; block_bytenr = arg_strtou64(optarg); ret = dump_add_tree_block(&block_root, block_bytenr); if (ret < 0) @@ -437,10 +436,10 @@ static int cmd_inspect_dump_tree(const struct cmd_struct *cmd, traverse = BTRFS_PRINT_TREE_BFS; break; case GETOPT_VAL_NOSCAN: - open_ctree_flags |= OPEN_CTREE_NO_DEVICES; + oca.flags |= OPEN_CTREE_NO_DEVICES; break; case GETOPT_VAL_HIDE_NAMES: - open_ctree_flags |= OPEN_CTREE_HIDE_NAMES; + oca.flags |= OPEN_CTREE_HIDE_NAMES; break; case GETOPT_VAL_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); oca.filename = argv[optind]; - oca.flags = open_ctree_flags; info = open_ctree_fs_info(&oca); if (!info) { error("unable to open %s", argv[optind]);