diff options
author | Simon Kirby <sim@hostway.ca> | 2013-03-19 18:41:23 -0400 |
---|---|---|
committer | Josef Bacik <jbacik@fusionio.com> | 2013-05-06 15:54:23 -0400 |
commit | c2cf52eb71aeb902682e0c1fa29e4e9e4a7f4ffc (patch) | |
tree | 6c62e02e87bc92eb8eb66bf4c0fbebc00b64a1e5 /fs/btrfs/print-tree.c | |
parent | aa8259145ecb8d432685c1167a194094559647a1 (diff) |
Btrfs: Include the device in most error printk()s
With more than one btrfs volume mounted, it can be very difficult to find
out which volume is hitting an error. btrfs_error() will print this, but
it is currently rigged as more of a fatal error handler, while many of
the printk()s are currently for debugging and yet-unhandled cases.
This patch just changes the functions where the device information is
already available. Some cases remain where the root or fs_info is not
passed to the function emitting the error.
This may introduce some confusion with volumes backed by multiple devices
emitting errors referring to the primary device in the set instead of the
one on which the error occurred.
Use btrfs_printk(fs_info, format, ...) rather than writing the device
string every time, and introduce macro wrappers ala XFS for brevity.
Since the function already cannot be used for continuations, print a
newline as part of the btrfs_printk() message rather than at each caller.
Signed-off-by: Simon Kirby <sim@hostway.ca>
Reviewed-by: David Sterba <dsterba@suse.cz>
Signed-off-by: Josef Bacik <jbacik@fusionio.com>
Diffstat (limited to 'fs/btrfs/print-tree.c')
-rw-r--r-- | fs/btrfs/print-tree.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/fs/btrfs/print-tree.c b/fs/btrfs/print-tree.c index 920957ecb27e..dc0024f17c1f 100644 --- a/fs/btrfs/print-tree.c +++ b/fs/btrfs/print-tree.c | |||
@@ -176,7 +176,7 @@ void btrfs_print_leaf(struct btrfs_root *root, struct extent_buffer *l) | |||
176 | 176 | ||
177 | nr = btrfs_header_nritems(l); | 177 | nr = btrfs_header_nritems(l); |
178 | 178 | ||
179 | printk(KERN_INFO "leaf %llu total ptrs %d free space %d\n", | 179 | btrfs_info(root->fs_info, "leaf %llu total ptrs %d free space %d", |
180 | (unsigned long long)btrfs_header_bytenr(l), nr, | 180 | (unsigned long long)btrfs_header_bytenr(l), nr, |
181 | btrfs_leaf_free_space(root, l)); | 181 | btrfs_leaf_free_space(root, l)); |
182 | for (i = 0 ; i < nr ; i++) { | 182 | for (i = 0 ; i < nr ; i++) { |
@@ -319,10 +319,9 @@ void btrfs_print_tree(struct btrfs_root *root, struct extent_buffer *c) | |||
319 | btrfs_print_leaf(root, c); | 319 | btrfs_print_leaf(root, c); |
320 | return; | 320 | return; |
321 | } | 321 | } |
322 | printk(KERN_INFO "node %llu level %d total ptrs %d free spc %u\n", | 322 | btrfs_info(root->fs_info, "node %llu level %d total ptrs %d free spc %u", |
323 | (unsigned long long)btrfs_header_bytenr(c), | 323 | (unsigned long long)btrfs_header_bytenr(c), |
324 | level, nr, | 324 | level, nr, (u32)BTRFS_NODEPTRS_PER_BLOCK(root) - nr); |
325 | (u32)BTRFS_NODEPTRS_PER_BLOCK(root) - nr); | ||
326 | for (i = 0; i < nr; i++) { | 325 | for (i = 0; i < nr; i++) { |
327 | btrfs_node_key_to_cpu(c, &key, i); | 326 | btrfs_node_key_to_cpu(c, &key, i); |
328 | printk(KERN_INFO "\tkey %d (%llu %u %llu) block %llu\n", | 327 | printk(KERN_INFO "\tkey %d (%llu %u %llu) block %llu\n", |