summaryrefslogtreecommitdiff
path: root/print-tree.c
diff options
context:
space:
mode:
authorQu Wenruo <quwenruo@cn.fujitsu.com>2015-11-03 14:48:09 +0800
committerDavid Sterba <dsterba@suse.com>2015-11-03 13:11:14 +0100
commit518fdbabd715600c698a78687aaebe7e957ca5e8 (patch)
tree96433d5a759d6eb1a9e0023c56718578f6b3be2f /print-tree.c
parentb160d29345eb9e9e7039c8ba4f6f3e6300f7112f (diff)
btrfs-progs: print-tree: Output stripe dev uuid
Add output for dev uuid for print_chunk(). Quite useful to debug temporary btrfs in btrfs-convert. Signed-off-by: Qu Wenruo <quwenruo@cn.fujitsu.com> Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'print-tree.c')
-rw-r--r--print-tree.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/print-tree.c b/print-tree.c
index 7ddf400d..4d4c3a2f 100644
--- a/print-tree.c
+++ b/print-tree.c
@@ -231,9 +231,17 @@ void print_chunk(struct extent_buffer *eb, struct btrfs_chunk *chunk)
printf("\t\ttype %s num_stripes %d\n",
chunk_flags_str, num_stripes);
for (i = 0 ; i < num_stripes ; i++) {
+ unsigned char dev_uuid[BTRFS_UUID_SIZE];
+ char str_dev_uuid[BTRFS_UUID_UNPARSED_SIZE];
+
+ read_extent_buffer(eb, dev_uuid,
+ (unsigned long)btrfs_stripe_dev_uuid_nr(chunk, i),
+ BTRFS_UUID_SIZE);
+ uuid_unparse(dev_uuid, str_dev_uuid);
printf("\t\t\tstripe %d devid %llu offset %llu\n", i,
(unsigned long long)btrfs_stripe_devid_nr(eb, chunk, i),
(unsigned long long)btrfs_stripe_offset_nr(eb, chunk, i));
+ printf("\t\t\tdev uuid: %s\n", str_dev_uuid);
}
}