summaryrefslogtreecommitdiff
path: root/cmds-balance.c
diff options
context:
space:
mode:
authorQu Wenruo <wqu@suse.com>2018-09-28 09:44:34 +0800
committerDavid Sterba <dsterba@suse.com>2018-10-31 18:24:14 +0100
commit0bbd407cbbd5746ac2f0f3ec4d89087276cf7510 (patch)
tree9345f460cf5d63b3e607795aad0aa4f2cec05b61 /cmds-balance.c
parent61c218756cd939ae5a475a593008f533931acba4 (diff)
btrfs-progs: print-tree: Introduce --bfs and --dfs options
Originally print-tree uses depth first search to print trees. This works fine until we reach 3 level trees (root node level is 2). For tall trees whose root level is 2 or higher, DFS will mix nodes and leaves like the following example: Level 2 A / \ Level 1 B C / | | \ Level 0 D E F G DFS will cause the following output sequence: A B D E C F G Which in term of node/leave is: N N L L N L L Such mixed node/leave result is sometimes hard for human to read. This patch will introduce 2 new options, --bfs and --dfs. --dfs: keeps the original output sequence, and to keep things compatible it's the default behavior. --bfs: uses breadth-first search, and will cause better output sequence like: A B C D E F G Which in term of node/leave is: N N N L L L L Much better sorted and may become default in the future. Reviewed-by: Nikolay Borisov <nborisov@suse.com> Signed-off-by: Qu Wenruo <wqu@suse.com> Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'cmds-balance.c')
0 files changed, 0 insertions, 0 deletions