diff options
| author | Alexey Fisher <bug-track@fisher-privat.net> | 2011-04-12 08:08:38 -0400 |
|---|---|---|
| committer | OGAWA Hirofumi <hirofumi@mail.parknet.co.jp> | 2011-04-12 08:12:35 -0400 |
| commit | 81ac21d34a91e85b029cd86e2ed5eeae8d7c3cd4 (patch) | |
| tree | ec3319428a074a2d9694844612f6fcbb39e21d53 | |
| parent | 2c8a5ffb94bbb4f04aaf8a923e9098fb7a51a75a (diff) | |
fat: Add fat_msg() function for preformated FAT messages
Add fat_msg() to replace not cosequent used printk() in fs/fat/*
New message format should be as fallow:
FAT-fs (sda1): some thing happened.
Signed-off-by: Alexey Fisher <bug-track@fisher-privat.net>
Signed-off-by: OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>
| -rw-r--r-- | fs/fat/fat.h | 2 | ||||
| -rw-r--r-- | fs/fat/misc.c | 16 |
2 files changed, 18 insertions, 0 deletions
diff --git a/fs/fat/fat.h b/fs/fat/fat.h index a768dad77907..8276cc282dec 100644 --- a/fs/fat/fat.h +++ b/fs/fat/fat.h | |||
| @@ -331,6 +331,8 @@ __fat_fs_error(struct super_block *sb, int report, const char *fmt, ...) | |||
| 331 | __fat_fs_error(sb, 1, fmt , ## args) | 331 | __fat_fs_error(sb, 1, fmt , ## args) |
| 332 | #define fat_fs_error_ratelimit(sb, fmt, args...) \ | 332 | #define fat_fs_error_ratelimit(sb, fmt, args...) \ |
| 333 | __fat_fs_error(sb, __ratelimit(&MSDOS_SB(sb)->ratelimit), fmt , ## args) | 333 | __fat_fs_error(sb, __ratelimit(&MSDOS_SB(sb)->ratelimit), fmt , ## args) |
| 334 | void fat_msg(struct super_block *sb, const char *level, const char *fmt, ...) | ||
| 335 | __attribute__ ((format (printf, 3, 4))) __cold; | ||
| 334 | extern int fat_clusters_flush(struct super_block *sb); | 336 | extern int fat_clusters_flush(struct super_block *sb); |
| 335 | extern int fat_chain_add(struct inode *inode, int new_dclus, int nr_cluster); | 337 | extern int fat_chain_add(struct inode *inode, int new_dclus, int nr_cluster); |
| 336 | extern void fat_time_fat2unix(struct msdos_sb_info *sbi, struct timespec *ts, | 338 | extern void fat_time_fat2unix(struct msdos_sb_info *sbi, struct timespec *ts, |
diff --git a/fs/fat/misc.c b/fs/fat/misc.c index e4f09629424e..3dcabc1bd8c3 100644 --- a/fs/fat/misc.c +++ b/fs/fat/misc.c | |||
| @@ -44,6 +44,22 @@ void __fat_fs_error(struct super_block *sb, int report, const char *fmt, ...) | |||
| 44 | } | 44 | } |
| 45 | EXPORT_SYMBOL_GPL(__fat_fs_error); | 45 | EXPORT_SYMBOL_GPL(__fat_fs_error); |
| 46 | 46 | ||
| 47 | /** | ||
| 48 | * fat_msg() - print preformated FAT specific messages. Every thing what is | ||
| 49 | * not fat_fs_error() should be fat_msg(). | ||
| 50 | */ | ||
| 51 | void fat_msg(struct super_block *sb, const char *level, const char *fmt, ...) | ||
| 52 | { | ||
| 53 | struct va_format vaf; | ||
| 54 | va_list args; | ||
| 55 | |||
| 56 | va_start(args, fmt); | ||
| 57 | vaf.fmt = fmt; | ||
| 58 | vaf.va = &args; | ||
| 59 | printk("%sFAT-fs (%s): %pV\n", level, sb->s_id, &vaf); | ||
| 60 | va_end(args); | ||
| 61 | } | ||
| 62 | |||
| 47 | /* Flushes the number of free clusters on FAT32 */ | 63 | /* Flushes the number of free clusters on FAT32 */ |
| 48 | /* XXX: Need to write one per FSINFO block. Currently only writes 1 */ | 64 | /* XXX: Need to write one per FSINFO block. Currently only writes 1 */ |
| 49 | int fat_clusters_flush(struct super_block *sb) | 65 | int fat_clusters_flush(struct super_block *sb) |
