summaryrefslogtreecommitdiff
path: root/print-tree.c
diff options
context:
space:
mode:
authorStefan Behrens <sbehrens@giantdisaster.de>2013-04-23 11:25:01 +0200
committerDavid Sterba <dsterba@suse.cz>2013-04-23 19:12:33 +0200
commit6b76570652e2f5a1f776848f330ca01e418a186c (patch)
tree722a8568667c673487f7be0485a7a86fb4f7f19e /print-tree.c
parent576bcca973567e6af8337d4f9f0d8703a83c556b (diff)
Btrfs-progs: in btrfs-debug-tree, print -1 in key for (u64)-1
For the objectid and offset field of a key, print -1 instead of the decimal representation of 0xffffffffffffffff. At least for me it is more readable like this. Signed-off-by: Stefan Behrens <sbehrens@giantdisaster.de>
Diffstat (limited to 'print-tree.c')
-rw-r--r--print-tree.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/print-tree.c b/print-tree.c
index 49c83840..aae47a94 100644
--- a/print-tree.c
+++ b/print-tree.c
@@ -585,6 +585,9 @@ static void print_objectid(u64 objectid, u8 type)
case BTRFS_MULTIPLE_OBJECTIDS:
printf("MULTIPLE");
break;
+ case (u64)-1:
+ printf("-1");
+ break;
case BTRFS_FIRST_CHUNK_TREE_OBJECTID:
if (type == BTRFS_CHUNK_ITEM_KEY) {
printf("FIRST_CHUNK_TREE");
@@ -614,7 +617,10 @@ void btrfs_print_key(struct btrfs_disk_key *disk_key)
(unsigned long long)(offset & ((1ll << 48) - 1)));
break;
default:
- printf(" %llu)", (unsigned long long)offset);
+ if (offset == (u64)-1)
+ printf(" -1)");
+ else
+ printf(" %llu)", (unsigned long long)offset);
break;
}
}