From: David Sterba Date: Mon, 9 Jun 2025 17:09:31 +0000 (+0200) Subject: btrfs: merge btrfs_printk_ratelimited() and its only caller X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b37532bffd35374b7816ef0629e8a1bbf12dc30b;p=thirdparty%2Flinux.git btrfs: merge btrfs_printk_ratelimited() and its only caller There's only one caller of btrfs_printk_ratelimited(), merge it there. Reviewed-by: Daniel Vacek Signed-off-by: David Sterba --- diff --git a/fs/btrfs/messages.h b/fs/btrfs/messages.h index 483524fccdc02..022ebc89af855 100644 --- a/fs/btrfs/messages.h +++ b/fs/btrfs/messages.h @@ -86,19 +86,15 @@ do { \ rcu_read_unlock(); \ } while (0) -#define btrfs_printk_ratelimited(fs_info, fmt, args...) \ +#define btrfs_printk_rl_in_rcu(fs_info, fmt, args...) \ do { \ static DEFINE_RATELIMIT_STATE(_rs, \ DEFAULT_RATELIMIT_INTERVAL, \ DEFAULT_RATELIMIT_BURST); \ + \ + rcu_read_lock(); \ if (__ratelimit(&_rs)) \ btrfs_printk(fs_info, fmt, ##args); \ -} while (0) - -#define btrfs_printk_rl_in_rcu(fs_info, fmt, args...) \ -do { \ - rcu_read_lock(); \ - btrfs_printk_ratelimited(fs_info, fmt, ##args); \ rcu_read_unlock(); \ } while (0)