diff options
author | Josef Bacik <jbacik@fb.com> | 2014-07-02 13:20:48 -0400 |
---|---|---|
committer | Chris Mason <clm@fb.com> | 2014-07-03 10:04:16 -0400 |
commit | be2c765dff9e5584965f78853c2addd2bb926946 (patch) | |
tree | 087291541080544ca0118410b1675ac5763c89e4 /fs/btrfs | |
parent | d288db5dc0110c8e0732d099aaf7a05e2ea0e0c8 (diff) |
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: Josef Bacik <jbacik@fb.com>
Signed-off-by: Chris Mason <clm@fb.com>
Diffstat (limited to 'fs/btrfs')
-rw-r--r-- | fs/btrfs/print-tree.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/fs/btrfs/print-tree.c b/fs/btrfs/print-tree.c index 6efd70d3b64f..9626b4ad3b9a 100644 --- a/fs/btrfs/print-tree.c +++ b/fs/btrfs/print-tree.c | |||
@@ -54,7 +54,7 @@ static void print_extent_data_ref(struct extent_buffer *eb, | |||
54 | btrfs_extent_data_ref_count(eb, ref)); | 54 | btrfs_extent_data_ref_count(eb, ref)); |
55 | } | 55 | } |
56 | 56 | ||
57 | static void print_extent_item(struct extent_buffer *eb, int slot) | 57 | static void print_extent_item(struct extent_buffer *eb, int slot, int type) |
58 | { | 58 | { |
59 | struct btrfs_extent_item *ei; | 59 | struct btrfs_extent_item *ei; |
60 | struct btrfs_extent_inline_ref *iref; | 60 | struct btrfs_extent_inline_ref *iref; |
@@ -63,7 +63,6 @@ static void print_extent_item(struct extent_buffer *eb, int slot) | |||
63 | struct btrfs_disk_key key; | 63 | struct btrfs_disk_key key; |
64 | unsigned long end; | 64 | unsigned long end; |
65 | unsigned long ptr; | 65 | unsigned long ptr; |
66 | int type; | ||
67 | u32 item_size = btrfs_item_size_nr(eb, slot); | 66 | u32 item_size = btrfs_item_size_nr(eb, slot); |
68 | u64 flags; | 67 | u64 flags; |
69 | u64 offset; | 68 | u64 offset; |
@@ -88,7 +87,8 @@ static void print_extent_item(struct extent_buffer *eb, int slot) | |||
88 | btrfs_extent_refs(eb, ei), btrfs_extent_generation(eb, ei), | 87 | btrfs_extent_refs(eb, ei), btrfs_extent_generation(eb, ei), |
89 | flags); | 88 | flags); |
90 | 89 | ||
91 | if (flags & BTRFS_EXTENT_FLAG_TREE_BLOCK) { | 90 | if ((type == BTRFS_EXTENT_ITEM_KEY) && |
91 | flags & BTRFS_EXTENT_FLAG_TREE_BLOCK) { | ||
92 | struct btrfs_tree_block_info *info; | 92 | struct btrfs_tree_block_info *info; |
93 | info = (struct btrfs_tree_block_info *)(ei + 1); | 93 | info = (struct btrfs_tree_block_info *)(ei + 1); |
94 | btrfs_tree_block_key(eb, info, &key); | 94 | btrfs_tree_block_key(eb, info, &key); |
@@ -223,7 +223,8 @@ void btrfs_print_leaf(struct btrfs_root *root, struct extent_buffer *l) | |||
223 | btrfs_disk_root_refs(l, ri)); | 223 | btrfs_disk_root_refs(l, ri)); |
224 | break; | 224 | break; |
225 | case BTRFS_EXTENT_ITEM_KEY: | 225 | case BTRFS_EXTENT_ITEM_KEY: |
226 | print_extent_item(l, i); | 226 | case BTRFS_METADATA_ITEM_KEY: |
227 | print_extent_item(l, i, type); | ||
227 | break; | 228 | break; |
228 | case BTRFS_TREE_BLOCK_REF_KEY: | 229 | case BTRFS_TREE_BLOCK_REF_KEY: |
229 | printk(KERN_INFO "\t\ttree block backref\n"); | 230 | printk(KERN_INFO "\t\ttree block backref\n"); |