Skip to content

Commit 2c8a5ff

Browse files
oleremOGAWAHirofumi
authored andcommitted
fat: Convert fat_fs_error to use %pV
- convert fat_fs_error to use %pV - be consequent and use "supor_block *sb" instead of "supor_block *s" - use devise name in each message. Signed-off-by: Alexey Fisher <bug-track@fisher-privat.net> Signed-off-by: OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>
1 parent 7003092 commit 2c8a5ff

2 files changed

Lines changed: 16 additions & 16 deletions

File tree

‎fs/fat/fat.h‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -325,12 +325,12 @@ extern int fat_flush_inodes(struct super_block *sb, struct inode *i1,
325325
struct inode *i2);
326326
/* fat/misc.c */
327327
extern void
328-
__fat_fs_error(struct super_block *s, int report, const char *fmt, ...)
328+
__fat_fs_error(struct super_block *sb, int report, const char *fmt, ...)
329329
__attribute__ ((format (printf, 3, 4))) __cold;
330-
#define fat_fs_error(s, fmt, args...) \
331-
__fat_fs_error(s, 1, fmt , ## args)
332-
#define fat_fs_error_ratelimit(s, fmt, args...) \
333-
__fat_fs_error(s, __ratelimit(&MSDOS_SB(s)->ratelimit), fmt , ## args)
330+
#define fat_fs_error(sb, fmt, args...) \
331+
__fat_fs_error(sb, 1, fmt , ## args)
332+
#define fat_fs_error_ratelimit(sb, fmt, args...) \
333+
__fat_fs_error(sb, __ratelimit(&MSDOS_SB(sb)->ratelimit), fmt , ## args)
334334
extern int fat_clusters_flush(struct super_block *sb);
335335
extern int fat_chain_add(struct inode *inode, int new_dclus, int nr_cluster);
336336
extern void fat_time_fat2unix(struct msdos_sb_info *sbi, struct timespec *ts,

‎fs/fat/misc.c‎

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -20,26 +20,26 @@
2020
* In case the file system is remounted read-only, it can be made writable
2121
* again by remounting it.
2222
*/
23-
void __fat_fs_error(struct super_block *s, int report, const char *fmt, ...)
23+
void __fat_fs_error(struct super_block *sb, int report, const char *fmt, ...)
2424
{
25-
struct fat_mount_options *opts = &MSDOS_SB(s)->options;
25+
struct fat_mount_options *opts = &MSDOS_SB(sb)->options;
2626
va_list args;
27+
struct va_format vaf;
2728

2829
if (report) {
29-
printk(KERN_ERR "FAT: Filesystem error (dev %s)\n", s->s_id);
30-
31-
printk(KERN_ERR " ");
3230
va_start(args, fmt);
33-
vprintk(fmt, args);
31+
vaf.fmt = fmt;
32+
vaf.va = &args;
33+
printk(KERN_ERR "FAT-fs (%s): error, %pV\n", sb->s_id, &vaf);
3434
va_end(args);
35-
printk("\n");
3635
}
3736

3837
if (opts->errors == FAT_ERRORS_PANIC)
39-
panic("FAT: fs panic from previous error\n");
40-
else if (opts->errors == FAT_ERRORS_RO && !(s->s_flags & MS_RDONLY)) {
41-
s->s_flags |= MS_RDONLY;
42-
printk(KERN_ERR "FAT: Filesystem has been set read-only\n");
38+
panic("FAT-fs (%s): fs panic from previous error\n", sb->s_id);
39+
else if (opts->errors == FAT_ERRORS_RO && !(sb->s_flags & MS_RDONLY)) {
40+
sb->s_flags |= MS_RDONLY;
41+
printk(KERN_ERR "FAT-fs (%s): Filesystem has been "
42+
"set read-only\n", sb->s_id);
4343
}
4444
}
4545
EXPORT_SYMBOL_GPL(__fat_fs_error);

0 commit comments

Comments
 (0)