Skip to content

Commit 9e0cc5e

Browse files
committed
btrfs: merge btrfs_printk_ratelimited() and it's only caller
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>
1 parent 266d244 commit 9e0cc5e

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

fs/btrfs/messages.h

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -86,19 +86,15 @@ do { \
8686
rcu_read_unlock(); \
8787
} while (0)
8888

89-
#define btrfs_printk_ratelimited(fs_info, fmt, args...) \
89+
#define btrfs_printk_rl_in_rcu(fs_info, fmt, args...) \
9090
do { \
9191
static DEFINE_RATELIMIT_STATE(_rs, \
9292
DEFAULT_RATELIMIT_INTERVAL, \
9393
DEFAULT_RATELIMIT_BURST); \
94+
\
95+
rcu_read_lock(); \
9496
if (__ratelimit(&_rs)) \
9597
btrfs_printk(fs_info, fmt, ##args); \
96-
} while (0)
97-
98-
#define btrfs_printk_rl_in_rcu(fs_info, fmt, args...) \
99-
do { \
100-
rcu_read_lock(); \
101-
btrfs_printk_ratelimited(fs_info, fmt, ##args); \
10298
rcu_read_unlock(); \
10399
} while (0)
104100

0 commit comments

Comments
 (0)