Commit 7e1e4167 authored by Fabian Frederick's avatar Fabian Frederick Committed by Linus Torvalds

fs/ufs/super.c: use va_format instead of buffer/vsnprintf

Remove error_buffer and use %pV
Signed-off-by: default avatarFabian Frederick <fabf@skynet.be>
Cc: Evgeniy Dushistov <dushistov@mail.ru>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 07bc94fd
...@@ -286,13 +286,12 @@ static void ufs_print_cylinder_stuff(struct super_block *sb, ...@@ -286,13 +286,12 @@ static void ufs_print_cylinder_stuff(struct super_block *sb,
static const struct super_operations ufs_super_ops; static const struct super_operations ufs_super_ops;
static char error_buf[1024];
void ufs_error (struct super_block * sb, const char * function, void ufs_error (struct super_block * sb, const char * function,
const char * fmt, ...) const char * fmt, ...)
{ {
struct ufs_sb_private_info * uspi; struct ufs_sb_private_info * uspi;
struct ufs_super_block_first * usb1; struct ufs_super_block_first * usb1;
struct va_format vaf;
va_list args; va_list args;
uspi = UFS_SB(sb)->s_uspi; uspi = UFS_SB(sb)->s_uspi;
...@@ -304,20 +303,21 @@ void ufs_error (struct super_block * sb, const char * function, ...@@ -304,20 +303,21 @@ void ufs_error (struct super_block * sb, const char * function,
ufs_mark_sb_dirty(sb); ufs_mark_sb_dirty(sb);
sb->s_flags |= MS_RDONLY; sb->s_flags |= MS_RDONLY;
} }
va_start (args, fmt); va_start(args, fmt);
vsnprintf (error_buf, sizeof(error_buf), fmt, args); vaf.fmt = fmt;
va_end (args); vaf.va = &args;
switch (UFS_SB(sb)->s_mount_opt & UFS_MOUNT_ONERROR) { switch (UFS_SB(sb)->s_mount_opt & UFS_MOUNT_ONERROR) {
case UFS_MOUNT_ONERROR_PANIC: case UFS_MOUNT_ONERROR_PANIC:
panic("panic (device %s): %s: %s\n", panic("panic (device %s): %s: %pV\n",
sb->s_id, function, error_buf); sb->s_id, function, &vaf);
case UFS_MOUNT_ONERROR_LOCK: case UFS_MOUNT_ONERROR_LOCK:
case UFS_MOUNT_ONERROR_UMOUNT: case UFS_MOUNT_ONERROR_UMOUNT:
case UFS_MOUNT_ONERROR_REPAIR: case UFS_MOUNT_ONERROR_REPAIR:
pr_crit("error (device %s): %s: %s\n", pr_crit("error (device %s): %s: %pV\n",
sb->s_id, function, error_buf); sb->s_id, function, &vaf);
} }
va_end(args);
} }
void ufs_panic (struct super_block * sb, const char * function, void ufs_panic (struct super_block * sb, const char * function,
...@@ -325,6 +325,7 @@ void ufs_panic (struct super_block * sb, const char * function, ...@@ -325,6 +325,7 @@ void ufs_panic (struct super_block * sb, const char * function,
{ {
struct ufs_sb_private_info * uspi; struct ufs_sb_private_info * uspi;
struct ufs_super_block_first * usb1; struct ufs_super_block_first * usb1;
struct va_format vaf;
va_list args; va_list args;
uspi = UFS_SB(sb)->s_uspi; uspi = UFS_SB(sb)->s_uspi;
...@@ -335,24 +336,27 @@ void ufs_panic (struct super_block * sb, const char * function, ...@@ -335,24 +336,27 @@ void ufs_panic (struct super_block * sb, const char * function,
ubh_mark_buffer_dirty(USPI_UBH(uspi)); ubh_mark_buffer_dirty(USPI_UBH(uspi));
ufs_mark_sb_dirty(sb); ufs_mark_sb_dirty(sb);
} }
va_start (args, fmt); va_start(args, fmt);
vsnprintf (error_buf, sizeof(error_buf), fmt, args); vaf.fmt = fmt;
va_end (args); vaf.va = &args;
sb->s_flags |= MS_RDONLY; sb->s_flags |= MS_RDONLY;
pr_crit("panic (device %s): %s: %s\n", pr_crit("panic (device %s): %s: %pV\n",
sb->s_id, function, error_buf); sb->s_id, function, &vaf);
va_end(args);
} }
void ufs_warning (struct super_block * sb, const char * function, void ufs_warning (struct super_block * sb, const char * function,
const char * fmt, ...) const char * fmt, ...)
{ {
struct va_format vaf;
va_list args; va_list args;
va_start (args, fmt); va_start(args, fmt);
vsnprintf (error_buf, sizeof(error_buf), fmt, args); vaf.fmt = fmt;
va_end (args); vaf.va = &args;
pr_warn("warning (device %s): %s: %s\n", pr_warn("(device %s): %s: %pV\n",
sb->s_id, function, error_buf); sb->s_id, function, &vaf);
va_end(args);
} }
enum { enum {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment