aboutsummaryrefslogtreecommitdiffstats
path: root/fs/btrfs/ctree.h
diff options
context:
space:
mode:
authorSimon Kirby <sim@hostway.ca>2013-03-19 18:41:23 -0400
committerJosef Bacik <jbacik@fusionio.com>2013-05-06 15:54:23 -0400
commitc2cf52eb71aeb902682e0c1fa29e4e9e4a7f4ffc (patch)
tree6c62e02e87bc92eb8eb66bf4c0fbebc00b64a1e5 /fs/btrfs/ctree.h
parentaa8259145ecb8d432685c1167a194094559647a1 (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/ctree.h')
-rw-r--r--fs/btrfs/ctree.h21
1 files changed, 19 insertions, 2 deletions
diff --git a/fs/btrfs/ctree.h b/fs/btrfs/ctree.h
index efb2feb7cd4a..5060990336a8 100644
--- a/fs/btrfs/ctree.h
+++ b/fs/btrfs/ctree.h
@@ -3643,14 +3643,31 @@ int btrfs_sync_fs(struct super_block *sb, int wait);
3643 3643
3644#ifdef CONFIG_PRINTK 3644#ifdef CONFIG_PRINTK
3645__printf(2, 3) 3645__printf(2, 3)
3646void btrfs_printk(struct btrfs_fs_info *fs_info, const char *fmt, ...); 3646void btrfs_printk(const struct btrfs_fs_info *fs_info, const char *fmt, ...);
3647#else 3647#else
3648static inline __printf(2, 3) 3648static inline __printf(2, 3)
3649void btrfs_printk(struct btrfs_fs_info *fs_info, const char *fmt, ...) 3649void btrfs_printk(const struct btrfs_fs_info *fs_info, const char *fmt, ...)
3650{ 3650{
3651} 3651}
3652#endif 3652#endif
3653 3653
3654#define btrfs_emerg(fs_info, fmt, args...) \
3655 btrfs_printk(fs_info, KERN_EMERG fmt, ##args)
3656#define btrfs_alert(fs_info, fmt, args...) \
3657 btrfs_printk(fs_info, KERN_ALERT fmt, ##args)
3658#define btrfs_crit(fs_info, fmt, args...) \
3659 btrfs_printk(fs_info, KERN_CRIT fmt, ##args)
3660#define btrfs_err(fs_info, fmt, args...) \
3661 btrfs_printk(fs_info, KERN_ERR fmt, ##args)
3662#define btrfs_warn(fs_info, fmt, args...) \
3663 btrfs_printk(fs_info, KERN_WARNING fmt, ##args)
3664#define btrfs_notice(fs_info, fmt, args...) \
3665 btrfs_printk(fs_info, KERN_NOTICE fmt, ##args)
3666#define btrfs_info(fs_info, fmt, args...) \
3667 btrfs_printk(fs_info, KERN_INFO fmt, ##args)
3668#define btrfs_debug(fs_info, fmt, args...) \
3669 btrfs_printk(fs_info, KERN_DEBUG fmt, ##args)
3670
3654__printf(5, 6) 3671__printf(5, 6)
3655void __btrfs_std_error(struct btrfs_fs_info *fs_info, const char *function, 3672void __btrfs_std_error(struct btrfs_fs_info *fs_info, const char *function,
3656 unsigned int line, int errno, const char *fmt, ...); 3673 unsigned int line, int errno, const char *fmt, ...);