mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-05-14 01:49:20 -04:00
btrfs: switch all message helpers to be RCU safe
We have two versions of message helpers, one that provides RCU protection around the call in case we need to dereference device name. As messages are not performance critical we can set up the RCU protection for all of them and drop the distinction for those where device name is needed. This will lead to further simplifications. Reviewed-by: Daniel Vacek <neelx@suse.com> Signed-off-by: David Sterba <dsterba@suse.com>
This commit is contained in:
@@ -37,14 +37,17 @@ void _btrfs_printk(const struct btrfs_fs_info *fs_info, const char *fmt, ...);
|
||||
btrfs_no_printk(fs_info, fmt, ##args)
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Print a message with filesystem info, enclosed in RCU protection.
|
||||
*/
|
||||
#define btrfs_crit(fs_info, fmt, args...) \
|
||||
btrfs_printk(fs_info, KERN_CRIT fmt, ##args)
|
||||
btrfs_printk_in_rcu(fs_info, KERN_CRIT fmt, ##args)
|
||||
#define btrfs_err(fs_info, fmt, args...) \
|
||||
btrfs_printk(fs_info, KERN_ERR fmt, ##args)
|
||||
btrfs_printk_in_rcu(fs_info, KERN_ERR fmt, ##args)
|
||||
#define btrfs_warn(fs_info, fmt, args...) \
|
||||
btrfs_printk(fs_info, KERN_WARNING fmt, ##args)
|
||||
btrfs_printk_in_rcu(fs_info, KERN_WARNING fmt, ##args)
|
||||
#define btrfs_info(fs_info, fmt, args...) \
|
||||
btrfs_printk(fs_info, KERN_INFO fmt, ##args)
|
||||
btrfs_printk_in_rcu(fs_info, KERN_INFO fmt, ##args)
|
||||
|
||||
/*
|
||||
* Wrappers that use printk in RCU
|
||||
@@ -74,17 +77,17 @@ void _btrfs_printk(const struct btrfs_fs_info *fs_info, const char *fmt, ...);
|
||||
* Wrappers that use a ratelimited printk
|
||||
*/
|
||||
#define btrfs_crit_rl(fs_info, fmt, args...) \
|
||||
btrfs_printk_ratelimited(fs_info, KERN_CRIT fmt, ##args)
|
||||
btrfs_printk_rl_in_rcu(fs_info, KERN_CRIT fmt, ##args)
|
||||
#define btrfs_err_rl(fs_info, fmt, args...) \
|
||||
btrfs_printk_ratelimited(fs_info, KERN_ERR fmt, ##args)
|
||||
btrfs_printk_rl_in_rcu(fs_info, KERN_ERR fmt, ##args)
|
||||
#define btrfs_warn_rl(fs_info, fmt, args...) \
|
||||
btrfs_printk_ratelimited(fs_info, KERN_WARNING fmt, ##args)
|
||||
btrfs_printk_rl_in_rcu(fs_info, KERN_WARNING fmt, ##args)
|
||||
#define btrfs_info_rl(fs_info, fmt, args...) \
|
||||
btrfs_printk_ratelimited(fs_info, KERN_INFO fmt, ##args)
|
||||
btrfs_printk_rl_in_rcu(fs_info, KERN_INFO fmt, ##args)
|
||||
|
||||
#if defined(CONFIG_DYNAMIC_DEBUG)
|
||||
#define btrfs_debug(fs_info, fmt, args...) \
|
||||
_dynamic_func_call_no_desc(fmt, btrfs_printk, \
|
||||
_dynamic_func_call_no_desc(fmt, btrfs_printk_in_rcu, \
|
||||
fs_info, KERN_DEBUG fmt, ##args)
|
||||
#define btrfs_debug_in_rcu(fs_info, fmt, args...) \
|
||||
_dynamic_func_call_no_desc(fmt, btrfs_printk_in_rcu, \
|
||||
@@ -93,26 +96,26 @@ void _btrfs_printk(const struct btrfs_fs_info *fs_info, const char *fmt, ...);
|
||||
_dynamic_func_call_no_desc(fmt, btrfs_printk_rl_in_rcu, \
|
||||
fs_info, KERN_DEBUG fmt, ##args)
|
||||
#define btrfs_debug_rl(fs_info, fmt, args...) \
|
||||
_dynamic_func_call_no_desc(fmt, btrfs_printk_ratelimited, \
|
||||
_dynamic_func_call_no_desc(fmt, btrfs_printk_rl_in_rcu, \
|
||||
fs_info, KERN_DEBUG fmt, ##args)
|
||||
#elif defined(DEBUG)
|
||||
#define btrfs_debug(fs_info, fmt, args...) \
|
||||
btrfs_printk(fs_info, KERN_DEBUG fmt, ##args)
|
||||
btrfs_printk_in_rcu(fs_info, KERN_DEBUG fmt, ##args)
|
||||
#define btrfs_debug_in_rcu(fs_info, fmt, args...) \
|
||||
btrfs_printk_in_rcu(fs_info, KERN_DEBUG fmt, ##args)
|
||||
#define btrfs_debug_rl_in_rcu(fs_info, 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)
|
||||
btrfs_printk_rl_in_rcu(fs_info, KERN_DEBUG fmt, ##args)
|
||||
#else
|
||||
#define btrfs_debug(fs_info, fmt, args...) \
|
||||
btrfs_no_printk(fs_info, KERN_DEBUG fmt, ##args)
|
||||
btrfs_no_printk_in_rcu(fs_info, KERN_DEBUG fmt, ##args)
|
||||
#define btrfs_debug_in_rcu(fs_info, fmt, args...) \
|
||||
btrfs_no_printk_in_rcu(fs_info, KERN_DEBUG fmt, ##args)
|
||||
#define btrfs_debug_rl_in_rcu(fs_info, fmt, args...) \
|
||||
btrfs_no_printk_in_rcu(fs_info, KERN_DEBUG fmt, ##args)
|
||||
#define btrfs_debug_rl(fs_info, fmt, args...) \
|
||||
btrfs_no_printk(fs_info, KERN_DEBUG fmt, ##args)
|
||||
btrfs_no_printk_in_rcu(fs_info, KERN_DEBUG fmt, ##args)
|
||||
#endif
|
||||
|
||||
#define btrfs_printk_in_rcu(fs_info, fmt, args...) \
|
||||
|
||||
Reference in New Issue
Block a user