]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
btrfs: merge btrfs_printk_ratelimited() and its only caller
authorDavid Sterba <dsterba@suse.com>
Mon, 9 Jun 2025 17:09:31 +0000 (19:09 +0200)
committerDavid Sterba <dsterba@suse.com>
Mon, 21 Jul 2025 21:56:39 +0000 (23:56 +0200)
There's only one caller of btrfs_printk_ratelimited(), merge it there.

Reviewed-by: Daniel Vacek <neelx@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/messages.h

index 483524fccdc02595079d87ed280b76464c14d03c..022ebc89af8550054d9a8faccc214bbfb088f38f 100644 (file)
@@ -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)