From: Namjae Jeon Date: Thu, 31 May 2012 23:26:13 +0000 (-0700) Subject: fat: add fat_msg_ratelimit() X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=b742c341539fc8b8386ef72f0e95758f39fbb4c8;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git fat: add fat_msg_ratelimit() Add a fat_msg_ratelimit() to limit the message generation rate. Signed-off-by: Namjae Jeon Signed-off-by: Amit Sahrawat Acked-by: OGAWA Hirofumi Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/fs/fat/fat.h b/fs/fat/fat.h index 951d12b61b58..fc35c5c69136 100644 --- a/fs/fat/fat.h +++ b/fs/fat/fat.h @@ -335,6 +335,11 @@ void __fat_fs_error(struct super_block *sb, int report, const char *fmt, ...); __fat_fs_error(sb, __ratelimit(&MSDOS_SB(sb)->ratelimit), fmt , ## args) __printf(3, 4) __cold void fat_msg(struct super_block *sb, const char *level, const char *fmt, ...); +#define fat_msg_ratelimit(sb, level, fmt, args...) \ + do { \ + if (__ratelimit(&MSDOS_SB(sb)->ratelimit)) \ + fat_msg(sb, level, fmt, ## args); \ + } while (0) extern int fat_clusters_flush(struct super_block *sb); extern int fat_chain_add(struct inode *inode, int new_dclus, int nr_cluster); extern void fat_time_fat2unix(struct msdos_sb_info *sbi, struct timespec *ts,