diff options
author | Jeff Mahoney <jeffm@suse.com> | 2016-06-22 18:54:23 -0400 |
---|---|---|
committer | David Sterba <dsterba@suse.com> | 2016-12-06 10:06:59 -0500 |
commit | 0b246afa62b0cf5b09d078121f543135f28492ad (patch) | |
tree | 200ad296d09f1b2f5329658c8de81bc625007ace /fs/btrfs/print-tree.c | |
parent | 6202df6921494f29308307e0ae6f567c2ab2ba19 (diff) |
btrfs: root->fs_info cleanup, add fs_info convenience variables
In routines where someptr->fs_info is referenced multiple times, we
introduce a convenience variable. This makes the code considerably
more readable.
Signed-off-by: Jeff Mahoney <jeffm@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'fs/btrfs/print-tree.c')
-rw-r--r-- | fs/btrfs/print-tree.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/fs/btrfs/print-tree.c b/fs/btrfs/print-tree.c index 57c403b205a5..3251a0dd03a2 100644 --- a/fs/btrfs/print-tree.c +++ b/fs/btrfs/print-tree.c | |||
@@ -163,6 +163,7 @@ static void print_uuid_item(struct extent_buffer *l, unsigned long offset, | |||
163 | 163 | ||
164 | void btrfs_print_leaf(struct btrfs_root *root, struct extent_buffer *l) | 164 | void btrfs_print_leaf(struct btrfs_root *root, struct extent_buffer *l) |
165 | { | 165 | { |
166 | struct btrfs_fs_info *fs_info = root->fs_info; | ||
166 | int i; | 167 | int i; |
167 | u32 type, nr; | 168 | u32 type, nr; |
168 | struct btrfs_item *item; | 169 | struct btrfs_item *item; |
@@ -182,7 +183,7 @@ void btrfs_print_leaf(struct btrfs_root *root, struct extent_buffer *l) | |||
182 | 183 | ||
183 | nr = btrfs_header_nritems(l); | 184 | nr = btrfs_header_nritems(l); |
184 | 185 | ||
185 | btrfs_info(root->fs_info, "leaf %llu total ptrs %d free space %d", | 186 | btrfs_info(fs_info, "leaf %llu total ptrs %d free space %d", |
186 | btrfs_header_bytenr(l), nr, btrfs_leaf_free_space(root, l)); | 187 | btrfs_header_bytenr(l), nr, btrfs_leaf_free_space(root, l)); |
187 | for (i = 0 ; i < nr ; i++) { | 188 | for (i = 0 ; i < nr ; i++) { |
188 | item = btrfs_item_nr(i); | 189 | item = btrfs_item_nr(i); |
@@ -316,6 +317,7 @@ void btrfs_print_leaf(struct btrfs_root *root, struct extent_buffer *l) | |||
316 | 317 | ||
317 | void btrfs_print_tree(struct btrfs_root *root, struct extent_buffer *c) | 318 | void btrfs_print_tree(struct btrfs_root *root, struct extent_buffer *c) |
318 | { | 319 | { |
320 | struct btrfs_fs_info *fs_info = root->fs_info; | ||
319 | int i; u32 nr; | 321 | int i; u32 nr; |
320 | struct btrfs_key key; | 322 | struct btrfs_key key; |
321 | int level; | 323 | int level; |
@@ -328,10 +330,10 @@ void btrfs_print_tree(struct btrfs_root *root, struct extent_buffer *c) | |||
328 | btrfs_print_leaf(root, c); | 330 | btrfs_print_leaf(root, c); |
329 | return; | 331 | return; |
330 | } | 332 | } |
331 | btrfs_info(root->fs_info, | 333 | btrfs_info(fs_info, |
332 | "node %llu level %d total ptrs %d free spc %u", | 334 | "node %llu level %d total ptrs %d free spc %u", |
333 | btrfs_header_bytenr(c), level, nr, | 335 | btrfs_header_bytenr(c), level, nr, |
334 | (u32)BTRFS_NODEPTRS_PER_BLOCK(root->fs_info) - nr); | 336 | (u32)BTRFS_NODEPTRS_PER_BLOCK(fs_info) - nr); |
335 | for (i = 0; i < nr; i++) { | 337 | for (i = 0; i < nr; i++) { |
336 | btrfs_node_key_to_cpu(c, &key, i); | 338 | btrfs_node_key_to_cpu(c, &key, i); |
337 | pr_info("\tkey %d (%llu %u %llu) block %llu\n", | 339 | pr_info("\tkey %d (%llu %u %llu) block %llu\n", |