summaryrefslogtreecommitdiff
path: root/print-tree.c
diff options
context:
space:
mode:
authorNikolay Borisov <nborisov@suse.com>2018-03-20 10:45:51 +0200
committerDavid Sterba <dsterba@suse.com>2018-03-30 22:15:54 +0200
commit30b852cd7e2299ba7795cd302d783724d88e101f (patch)
treeb55dc585b672e6efe57b4123af369c81da8e266c /print-tree.c
parent82a1442e9cd025436be8ae65e684fd6b2701efbb (diff)
btrfs-progs: Beautify owner when printing leaf/nodes
Currently we print the raw values of the owner field of leaf/nodes. This can result in output like the following: leaf 30490624 items 2 free space 16061 generation 4 owner 18446744073709551607 With the patch applied the same leaf looks like: leaf 30490624 items 2 free space 16061 generation 4 owner DATA_RELOC_TREE Signed-off-by: Nikolay Borisov <nborisov@suse.com> Reviewed-by: Qu Wenruo <wqu@suse.com> Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'print-tree.c')
-rw-r--r--print-tree.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/print-tree.c b/print-tree.c
index d59f9002..a2f6bfc0 100644
--- a/print-tree.c
+++ b/print-tree.c
@@ -1188,11 +1188,12 @@ void btrfs_print_leaf(struct btrfs_root *root, struct extent_buffer *eb)
header_flags_to_str(flags, flags_str);
nr = btrfs_header_nritems(eb);
- printf("leaf %llu items %d free space %d generation %llu owner %llu\n",
+ printf("leaf %llu items %d free space %d generation %llu owner ",
(unsigned long long)btrfs_header_bytenr(eb), nr,
btrfs_leaf_free_space(root, eb),
- (unsigned long long)btrfs_header_generation(eb),
- (unsigned long long)btrfs_header_owner(eb));
+ (unsigned long long)btrfs_header_generation(eb));
+ print_objectid(stdout, btrfs_header_owner(eb), 0);
+ printf("\n");
printf("leaf %llu flags 0x%llx(%s) backref revision %d\n",
btrfs_header_bytenr(eb), flags, flags_str, backref_rev);
print_uuids(eb);
@@ -1365,12 +1366,13 @@ void btrfs_print_tree(struct btrfs_root *root, struct extent_buffer *eb, int fol
btrfs_print_leaf(root, eb);
return;
}
- printf("node %llu level %d items %d free %u generation %llu owner %llu\n",
+ printf("node %llu level %d items %d free %u generation %llu owner ",
(unsigned long long)eb->start,
btrfs_header_level(eb), nr,
(u32)BTRFS_NODEPTRS_PER_BLOCK(root->fs_info) - nr,
- (unsigned long long)btrfs_header_generation(eb),
- (unsigned long long)btrfs_header_owner(eb));
+ (unsigned long long)btrfs_header_generation(eb));
+ print_objectid(stdout, btrfs_header_owner(eb), 0);
+ printf("\n");
print_uuids(eb);
fflush(stdout);
for (i = 0; i < nr; i++) {