diff options
author | David Sterba <dsterba@suse.com> | 2016-10-31 16:31:15 +0100 |
---|---|---|
committer | David Sterba <dsterba@suse.com> | 2016-11-09 13:47:30 +0100 |
commit | 5d43dfd344b6b36d6922039363ca89f80f779313 (patch) | |
tree | 77bf266970740ae09369ec4d441068ae30091852 /print-tree.c | |
parent | 069b0b6d14fd3d060046cd96d877e65d6f4b5c86 (diff) |
btrfs-progs: dump-tree: print missing data for file extent item
Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'print-tree.c')
-rw-r--r-- | print-tree.c | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/print-tree.c b/print-tree.c index 56317c27..efaf6fb9 100644 --- a/print-tree.c +++ b/print-tree.c @@ -327,6 +327,16 @@ static void compress_type_to_str(u8 compress_type, char *ret) } } +static const char* file_extent_type_to_str(u8 type) +{ + switch (type) { + case BTRFS_FILE_EXTENT_INLINE: return "inline"; + case BTRFS_FILE_EXTENT_PREALLOC: return "prealloc"; + case BTRFS_FILE_EXTENT_REG: return "regular"; + default: return "unknown"; + } +} + static void print_file_extent_item(struct extent_buffer *eb, struct btrfs_item *item, int slot, @@ -338,9 +348,12 @@ static void print_file_extent_item(struct extent_buffer *eb, compress_type_to_str(btrfs_file_extent_compression(eb, fi), compress_str); + printf("\t\tgeneration %llu type %hhu (%s)\n", + btrfs_file_extent_generation(eb, fi), + extent_type, file_extent_type_to_str(extent_type)); + if (extent_type == BTRFS_FILE_EXTENT_INLINE) { - printf("\t\tinline extent data size %u " - "ram %u compress(%s)\n", + printf("\t\tinline extent data size %u ram %u compress(%s)\n", btrfs_file_extent_inline_item_len(eb, item), btrfs_file_extent_inline_len(eb, slot, fi), compress_str); |