Skip to contentSkip to conversation

fat: add fat_msg_ratelimit.

PATCH In review Namjae Jeon 2 participants 2 messages May 15, 2012 VFAT/FAT/msdos filesystem

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 fat: add fat_msg_ratelimit.

I tried to add fat_msg_ratelimit to limit many message at once.

---
 fs/fat/fat.h |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)
fs/fat/fat.h +5 -0
index 951d12b..1708d9a 100644
@@ -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,
Signature · 1 line
1.7.5.4
maintainer
#1 lore raw
Quoted 5 lines · Namjae Jeon

I tried to add fat_msg_ratelimit to limit many message at once.

Thanks.

Please handle those patches, Andrew.

Quoted 19 lines
 fs/fat/fat.h |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)
fs/fat/fat.h +5 -0
index 951d12b..1708d9a 100644
@@ -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,
Signature · 1 line
OGAWA Hirofumi <[email protected]>