btrfs-progs: dump-tree: print missing dev_extent data

Add items from chunk that are not printed, unify names according to
the member names and reorder a bit.

Signed-off-by: David Sterba <dsterba@suse.com>
This commit is contained in:
David Sterba 2016-10-31 14:25:03 +01:00
parent c6cd8ff6ec
commit cae265e816
1 changed files with 10 additions and 2 deletions

View File

@ -933,6 +933,8 @@ void btrfs_print_leaf(struct btrfs_root *root, struct extent_buffer *l)
u64 objectid; u64 objectid;
u32 type; u32 type;
char flags_str[256]; char flags_str[256];
char uuid_str[BTRFS_UUID_UNPARSED_SIZE];
u8 uuid[BTRFS_UUID_SIZE];
printf("leaf %llu items %d free space %d generation %llu owner %llu\n", printf("leaf %llu items %d free space %d generation %llu owner %llu\n",
(unsigned long long)btrfs_header_bytenr(l), nr, (unsigned long long)btrfs_header_bytenr(l), nr,
@ -1087,9 +1089,14 @@ void btrfs_print_leaf(struct btrfs_root *root, struct extent_buffer *l)
case BTRFS_DEV_EXTENT_KEY: case BTRFS_DEV_EXTENT_KEY:
dev_extent = btrfs_item_ptr(l, i, dev_extent = btrfs_item_ptr(l, i,
struct btrfs_dev_extent); struct btrfs_dev_extent);
read_extent_buffer(l, uuid,
(unsigned long)btrfs_dev_extent_chunk_tree_uuid(dev_extent),
BTRFS_UUID_SIZE);
uuid_unparse(uuid, uuid_str);
printf("\t\tdev extent chunk_tree %llu\n" printf("\t\tdev extent chunk_tree %llu\n"
"\t\tchunk objectid %llu chunk offset %llu " "\t\tchunk objectid %llu chunk offset %llu "
"length %llu\n", "length %llu\n"
"\t\tchunk_tree_uuid %s\n",
(unsigned long long) (unsigned long long)
btrfs_dev_extent_chunk_tree(l, dev_extent), btrfs_dev_extent_chunk_tree(l, dev_extent),
(unsigned long long) (unsigned long long)
@ -1097,7 +1104,8 @@ void btrfs_print_leaf(struct btrfs_root *root, struct extent_buffer *l)
(unsigned long long) (unsigned long long)
btrfs_dev_extent_chunk_offset(l, dev_extent), btrfs_dev_extent_chunk_offset(l, dev_extent),
(unsigned long long) (unsigned long long)
btrfs_dev_extent_length(l, dev_extent)); btrfs_dev_extent_length(l, dev_extent),
uuid_str);
break; break;
case BTRFS_QGROUP_STATUS_KEY: case BTRFS_QGROUP_STATUS_KEY:
qg_status = btrfs_item_ptr(l, i, qg_status = btrfs_item_ptr(l, i,