From 61907d4e8164ed9504a00b8e2c4ca6601f126b0d Mon Sep 17 00:00:00 2001 From: Shen Feng Date: Wed, 3 Jun 2009 12:02:23 -0400 Subject: 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 Signed-off-by: Chris Mason --- debug-tree.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'debug-tree.c') 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); -- cgit v1.2.3