mirror of
https://github.com/kdave/btrfs-progs
synced 2024-12-23 14:45:19 +00:00
btrfs-progs: dump-tree: Also output log root tree
In btrfs-dump-tree, we output any existing log tree, however we don't output the log root tree, which records all root items for log trees. This makes it confusing for any one who want to know where the log tree comes from. Signed-off-by: Qu Wenruo <quwenruo@cn.fujitsu.com> Signed-off-by: David Sterba <dsterba@suse.com>
This commit is contained in:
parent
3d4c030d7f
commit
c3d38a1880
@ -344,6 +344,11 @@ int cmd_inspect_dump_tree(int argc, char **argv)
|
||||
printf("chunk tree: %llu level %d\n",
|
||||
(unsigned long long)info->chunk_root->node->start,
|
||||
btrfs_header_level(info->chunk_root->node));
|
||||
if (info->log_root_tree)
|
||||
printf("log root tree: %llu level %d\n",
|
||||
info->log_root_tree->node->start,
|
||||
btrfs_header_level(
|
||||
info->log_root_tree->node));
|
||||
} else {
|
||||
if (info->tree_root->node) {
|
||||
printf("root tree\n");
|
||||
@ -356,6 +361,12 @@ int cmd_inspect_dump_tree(int argc, char **argv)
|
||||
btrfs_print_tree(info->chunk_root,
|
||||
info->chunk_root->node, 1);
|
||||
}
|
||||
|
||||
if (info->log_root_tree) {
|
||||
printf("log root tree\n");
|
||||
btrfs_print_tree(info->log_root_tree,
|
||||
info->log_root_tree->node, 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
tree_root_scan = info->tree_root;
|
||||
@ -388,6 +399,17 @@ again:
|
||||
goto close_root;
|
||||
}
|
||||
|
||||
if (tree_id && tree_id == BTRFS_TREE_LOG_OBJECTID) {
|
||||
if (!info->log_root_tree) {
|
||||
error("cannot print log root tree, invalid pointer");
|
||||
goto close_root;
|
||||
}
|
||||
printf("log root tree\n");
|
||||
btrfs_print_tree(info->log_root_tree, info->log_root_tree->node,
|
||||
1);
|
||||
goto close_root;
|
||||
}
|
||||
|
||||
key.offset = 0;
|
||||
key.objectid = 0;
|
||||
key.type = BTRFS_ROOT_ITEM_KEY;
|
||||
|
Loading…
Reference in New Issue
Block a user