Commit be2c765d authored by Josef Bacik's avatar Josef Bacik Committed by Chris Mason

Btrfs: fix btrfs_print_leaf for skinny metadata

We wouldn't actuall print the extent information if we had a skinny metadata
item, this fixes that.  Thanks,
Signed-off-by: default avatarJosef Bacik <jbacik@fb.com>
Signed-off-by: default avatarChris Mason <clm@fb.com>
parent d288db5d
...@@ -54,7 +54,7 @@ static void print_extent_data_ref(struct extent_buffer *eb, ...@@ -54,7 +54,7 @@ static void print_extent_data_ref(struct extent_buffer *eb,
btrfs_extent_data_ref_count(eb, ref)); btrfs_extent_data_ref_count(eb, ref));
} }
static void print_extent_item(struct extent_buffer *eb, int slot) static void print_extent_item(struct extent_buffer *eb, int slot, int type)
{ {
struct btrfs_extent_item *ei; struct btrfs_extent_item *ei;
struct btrfs_extent_inline_ref *iref; struct btrfs_extent_inline_ref *iref;
...@@ -63,7 +63,6 @@ static void print_extent_item(struct extent_buffer *eb, int slot) ...@@ -63,7 +63,6 @@ static void print_extent_item(struct extent_buffer *eb, int slot)
struct btrfs_disk_key key; struct btrfs_disk_key key;
unsigned long end; unsigned long end;
unsigned long ptr; unsigned long ptr;
int type;
u32 item_size = btrfs_item_size_nr(eb, slot); u32 item_size = btrfs_item_size_nr(eb, slot);
u64 flags; u64 flags;
u64 offset; u64 offset;
...@@ -88,7 +87,8 @@ static void print_extent_item(struct extent_buffer *eb, int slot) ...@@ -88,7 +87,8 @@ static void print_extent_item(struct extent_buffer *eb, int slot)
btrfs_extent_refs(eb, ei), btrfs_extent_generation(eb, ei), btrfs_extent_refs(eb, ei), btrfs_extent_generation(eb, ei),
flags); flags);
if (flags & BTRFS_EXTENT_FLAG_TREE_BLOCK) { if ((type == BTRFS_EXTENT_ITEM_KEY) &&
flags & BTRFS_EXTENT_FLAG_TREE_BLOCK) {
struct btrfs_tree_block_info *info; struct btrfs_tree_block_info *info;
info = (struct btrfs_tree_block_info *)(ei + 1); info = (struct btrfs_tree_block_info *)(ei + 1);
btrfs_tree_block_key(eb, info, &key); btrfs_tree_block_key(eb, info, &key);
...@@ -223,7 +223,8 @@ void btrfs_print_leaf(struct btrfs_root *root, struct extent_buffer *l) ...@@ -223,7 +223,8 @@ void btrfs_print_leaf(struct btrfs_root *root, struct extent_buffer *l)
btrfs_disk_root_refs(l, ri)); btrfs_disk_root_refs(l, ri));
break; break;
case BTRFS_EXTENT_ITEM_KEY: case BTRFS_EXTENT_ITEM_KEY:
print_extent_item(l, i); case BTRFS_METADATA_ITEM_KEY:
print_extent_item(l, i, type);
break; break;
case BTRFS_TREE_BLOCK_REF_KEY: case BTRFS_TREE_BLOCK_REF_KEY:
printk(KERN_INFO "\t\ttree block backref\n"); printk(KERN_INFO "\t\ttree block backref\n");
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment