btrfs: introduce ratelimited variants of message printing functions

Signed-off-by: David Sterba <dsterba@suse.com>
This commit is contained in:
David Sterba 2015-10-08 10:51:11 +02:00
parent b14af3b46f
commit 1dd6d7ca9d
1 changed files with 21 additions and 0 deletions

View File

@ -4075,6 +4075,23 @@ void btrfs_printk(const struct btrfs_fs_info *fs_info, const char *fmt, ...)
#define btrfs_info_rl_in_rcu(fs_info, fmt, args...) \ #define btrfs_info_rl_in_rcu(fs_info, fmt, args...) \
btrfs_printk_rl_in_rcu(fs_info, KERN_INFO fmt, ##args) btrfs_printk_rl_in_rcu(fs_info, KERN_INFO fmt, ##args)
/*
* Wrappers that use a ratelimited printk
*/
#define btrfs_emerg_rl(fs_info, fmt, args...) \
btrfs_printk_ratelimited(fs_info, KERN_EMERG fmt, ##args)
#define btrfs_alert_rl(fs_info, fmt, args...) \
btrfs_printk_ratelimited(fs_info, KERN_ALERT fmt, ##args)
#define btrfs_crit_rl(fs_info, fmt, args...) \
btrfs_printk_ratelimited(fs_info, KERN_CRIT fmt, ##args)
#define btrfs_err_rl(fs_info, fmt, args...) \
btrfs_printk_ratelimited(fs_info, KERN_ERR fmt, ##args)
#define btrfs_warn_rl(fs_info, fmt, args...) \
btrfs_printk_ratelimited(fs_info, KERN_WARNING fmt, ##args)
#define btrfs_notice_rl(fs_info, fmt, args...) \
btrfs_printk_ratelimited(fs_info, KERN_NOTICE fmt, ##args)
#define btrfs_info_rl(fs_info, fmt, args...) \
btrfs_printk_ratelimited(fs_info, KERN_INFO fmt, ##args)
#ifdef DEBUG #ifdef DEBUG
#define btrfs_debug(fs_info, fmt, args...) \ #define btrfs_debug(fs_info, fmt, args...) \
btrfs_printk(fs_info, KERN_DEBUG fmt, ##args) btrfs_printk(fs_info, KERN_DEBUG fmt, ##args)
@ -4082,6 +4099,8 @@ void btrfs_printk(const struct btrfs_fs_info *fs_info, const char *fmt, ...)
btrfs_printk_in_rcu(fs_info, KERN_DEBUG fmt, ##args) btrfs_printk_in_rcu(fs_info, KERN_DEBUG fmt, ##args)
#define btrfs_debug_rl_in_rcu(fs_info, fmt, args...) \ #define btrfs_debug_rl_in_rcu(fs_info, fmt, args...) \
btrfs_printk_rl_in_rcu(fs_info, KERN_DEBUG fmt, ##args) btrfs_printk_rl_in_rcu(fs_info, KERN_DEBUG fmt, ##args)
#define btrfs_debug_rl(fs_info, fmt, args...) \
btrfs_printk_ratelimited(fs_info, KERN_DEBUG fmt, ##args)
#else #else
#define btrfs_debug(fs_info, fmt, args...) \ #define btrfs_debug(fs_info, fmt, args...) \
no_printk(KERN_DEBUG fmt, ##args) no_printk(KERN_DEBUG fmt, ##args)
@ -4089,6 +4108,8 @@ void btrfs_printk(const struct btrfs_fs_info *fs_info, const char *fmt, ...)
no_printk(KERN_DEBUG fmt, ##args) no_printk(KERN_DEBUG fmt, ##args)
#define btrfs_debug_rl_in_rcu(fs_info, fmt, args...) \ #define btrfs_debug_rl_in_rcu(fs_info, fmt, args...) \
no_printk(KERN_DEBUG fmt, ##args) no_printk(KERN_DEBUG fmt, ##args)
#define btrfs_debug_rl(fs_info, fmt, args...) \
no_printk(KERN_DEBUG fmt, ##args)
#endif #endif
#define btrfs_printk_in_rcu(fs_info, fmt, args...) \ #define btrfs_printk_in_rcu(fs_info, fmt, args...) \