diff options
author | Shen Feng <shen@cn.fujitsu.com> | 2009-06-03 12:02:23 -0400 |
---|---|---|
committer | Chris Mason <chris.mason@oracle.com> | 2009-06-03 12:15:40 -0400 |
commit | 61907d4e8164ed9504a00b8e2c4ca6601f126b0d (patch) | |
tree | 4b0bb98de167d7a1e2c356fe87ca62f06e8fe0ca /debug-tree.c | |
parent | 0869c0ca7cbd996ccf337695cc0c8e3aa1447111 (diff) |
Update btrfs-debug-tree to output more readable strings.
output objectid in btrfs_disk_key with human readable strings.
Other updates are included for more readable output.
Thanks Fengguang's fix to this patch.
Signed-off-by: Shen Feng <shen@cn.fujitsu.com>
Signed-off-by: Chris Mason <chris.mason@oracle.com>
Diffstat (limited to 'debug-tree.c')
-rw-r--r-- | debug-tree.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/debug-tree.c b/debug-tree.c index 03881212..e22d3f5b 100644 --- a/debug-tree.c +++ b/debug-tree.c @@ -108,6 +108,7 @@ int main(int ac, char **av) struct btrfs_key key; struct btrfs_root_item ri; struct extent_buffer *leaf; + struct btrfs_disk_key disk_key; struct btrfs_key found_key; char uuidbuf[37]; int ret; @@ -167,7 +168,8 @@ again: leaf = path.nodes[0]; slot = path.slots[0]; } - btrfs_item_key_to_cpu(leaf, &found_key, path.slots[0]); + btrfs_item_key(leaf, &disk_key, path.slots[0]); + btrfs_disk_key_to_cpu(&found_key, &disk_key); if (btrfs_key_type(&found_key) == BTRFS_ROOT_ITEM_KEY) { unsigned long offset; struct extent_buffer *buf; @@ -253,10 +255,9 @@ again: } } if (!skip && !extent_only) { - printf(" tree (%llu %u %llu)\n", - (unsigned long long)found_key.objectid, - found_key.type, - (unsigned long long)found_key.offset); + printf(" tree "); + btrfs_print_key(&disk_key); + printf(" \n"); btrfs_print_tree(tree_root_scan, buf); } else if (extent_only && !skip) { print_extents(tree_root_scan, buf); |