btrfs-progs: dump-tree: print missing data for file extent item

Signed-off-by: David Sterba <dsterba@suse.com>
This commit is contained in:
David Sterba 2016-10-31 16:31:15 +01:00
parent 069b0b6d14
commit 5d43dfd344
1 changed files with 15 additions and 2 deletions

View File

@ -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);