forked from Mirrors/btrfs-progs
btrfs-progs: print-tree: Use bool for @follow
Just a minor cleanup to make the parameter easier to read. Signed-off-by: Qu Wenruo <wqu@suse.com> Signed-off-by: David Sterba <dsterba@suse.com>master
parent
0bbd407cbb
commit
9f6d9ec10c
|
@ -384,20 +384,20 @@ int cmd_inspect_dump_tree(int argc, char **argv)
|
|||
} else {
|
||||
if (info->tree_root->node) {
|
||||
printf("root tree\n");
|
||||
btrfs_print_tree(info->tree_root->node, 1,
|
||||
btrfs_print_tree(info->tree_root->node, true,
|
||||
traverse);
|
||||
}
|
||||
|
||||
if (info->chunk_root->node) {
|
||||
printf("chunk tree\n");
|
||||
btrfs_print_tree(info->chunk_root->node, 1,
|
||||
btrfs_print_tree(info->chunk_root->node, true,
|
||||
traverse);
|
||||
}
|
||||
|
||||
if (info->log_root_tree) {
|
||||
printf("log root tree\n");
|
||||
btrfs_print_tree(info->log_root_tree->node, 1,
|
||||
traverse);
|
||||
btrfs_print_tree(info->log_root_tree->node,
|
||||
true, traverse);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -417,7 +417,7 @@ again:
|
|||
goto close_root;
|
||||
}
|
||||
printf("root tree\n");
|
||||
btrfs_print_tree(info->tree_root->node, 1, traverse);
|
||||
btrfs_print_tree(info->tree_root->node, true, traverse);
|
||||
goto close_root;
|
||||
}
|
||||
|
||||
|
@ -427,7 +427,7 @@ again:
|
|||
goto close_root;
|
||||
}
|
||||
printf("chunk tree\n");
|
||||
btrfs_print_tree(info->chunk_root->node, 1, traverse);
|
||||
btrfs_print_tree(info->chunk_root->node, true, traverse);
|
||||
goto close_root;
|
||||
}
|
||||
|
||||
|
@ -437,7 +437,7 @@ again:
|
|||
goto close_root;
|
||||
}
|
||||
printf("log root tree\n");
|
||||
btrfs_print_tree(info->log_root_tree->node, 1, traverse);
|
||||
btrfs_print_tree(info->log_root_tree->node, true, traverse);
|
||||
goto close_root;
|
||||
}
|
||||
|
||||
|
@ -583,7 +583,7 @@ again:
|
|||
btrfs_header_level(buf));
|
||||
} else {
|
||||
printf(" \n");
|
||||
btrfs_print_tree(buf, 1, traverse);
|
||||
btrfs_print_tree(buf, true, traverse);
|
||||
}
|
||||
}
|
||||
free_extent_buffer(buf);
|
||||
|
|
|
@ -1485,7 +1485,7 @@ static void dfs_print_children(struct extent_buffer *root_eb)
|
|||
}
|
||||
}
|
||||
|
||||
void btrfs_print_tree(struct extent_buffer *eb, int follow, int traverse)
|
||||
void btrfs_print_tree(struct extent_buffer *eb, bool follow, int traverse)
|
||||
{
|
||||
u32 i;
|
||||
u32 nr;
|
||||
|
|
|
@ -25,14 +25,14 @@ void btrfs_print_leaf(struct extent_buffer *l);
|
|||
* Print a tree block (applies to both node and leaf).
|
||||
*
|
||||
* @eb: Tree block
|
||||
* @follow: Set non-zero to print all its children.
|
||||
* @follow: Set true to print all its children.
|
||||
* @traverse: The traverse order. Support DFS and BFS.
|
||||
* Will fallback to DFS for unknown order.
|
||||
*/
|
||||
#define BTRFS_PRINT_TREE_DFS 0
|
||||
#define BTRFS_PRINT_TREE_BFS 1
|
||||
#define BTRFS_PRINT_TREE_DEFAULT BTRFS_PRINT_TREE_DFS
|
||||
void btrfs_print_tree(struct extent_buffer *eb, int follow, int traverse);
|
||||
void btrfs_print_tree(struct extent_buffer *eb, bool follow, int traverse);
|
||||
|
||||
void btrfs_print_key(struct btrfs_disk_key *disk_key);
|
||||
void print_chunk_item(struct extent_buffer *eb, struct btrfs_chunk *chunk);
|
||||
|
|
Loading…
Reference in New Issue