diff options
Diffstat (limited to 'fs/btrfs/print-tree.c')
-rw-r--r-- | fs/btrfs/print-tree.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/fs/btrfs/print-tree.c b/fs/btrfs/print-tree.c index fb2605d998e9..f38e452486b8 100644 --- a/fs/btrfs/print-tree.c +++ b/fs/btrfs/print-tree.c | |||
@@ -158,8 +158,7 @@ static void print_extent_ref_v0(struct extent_buffer *eb, int slot) | |||
158 | void btrfs_print_leaf(struct btrfs_root *root, struct extent_buffer *l) | 158 | void btrfs_print_leaf(struct btrfs_root *root, struct extent_buffer *l) |
159 | { | 159 | { |
160 | int i; | 160 | int i; |
161 | u32 type; | 161 | u32 type, nr; |
162 | u32 nr = btrfs_header_nritems(l); | ||
163 | struct btrfs_item *item; | 162 | struct btrfs_item *item; |
164 | struct btrfs_root_item *ri; | 163 | struct btrfs_root_item *ri; |
165 | struct btrfs_dir_item *di; | 164 | struct btrfs_dir_item *di; |
@@ -172,6 +171,11 @@ void btrfs_print_leaf(struct btrfs_root *root, struct extent_buffer *l) | |||
172 | struct btrfs_key key; | 171 | struct btrfs_key key; |
173 | struct btrfs_key found_key; | 172 | struct btrfs_key found_key; |
174 | 173 | ||
174 | if (!l) | ||
175 | return; | ||
176 | |||
177 | nr = btrfs_header_nritems(l); | ||
178 | |||
175 | printk(KERN_INFO "leaf %llu total ptrs %d free space %d\n", | 179 | printk(KERN_INFO "leaf %llu total ptrs %d free space %d\n", |
176 | (unsigned long long)btrfs_header_bytenr(l), nr, | 180 | (unsigned long long)btrfs_header_bytenr(l), nr, |
177 | btrfs_leaf_free_space(root, l)); | 181 | btrfs_leaf_free_space(root, l)); |