aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ext3/super.c
diff options
context:
space:
mode:
authorJoe Perches <joe@perches.com>2010-11-09 13:18:05 -0500
committerJan Kara <jack@suse.cz>2011-01-06 05:52:14 -0500
commit99fbb1e2af5da27d3ee75c2e421712fe9d083fb6 (patch)
tree404fd6c3a478ba5feb3eded8769813b1c8838e45 /fs/ext3/super.c
parent23a2ad6d0e58d0f2fb1647c2d6fef935bcaf9299 (diff)
fs/ext3/super.c: Use printf extension %pV
Using %pV reduces the number of printk calls and eliminates any possible message interleaving from other printk calls. Signed-off-by: Joe Perches <joe@perches.com> Signed-off-by: Jan Kara <jack@suse.cz>
Diffstat (limited to 'fs/ext3/super.c')
-rw-r--r--fs/ext3/super.c56
1 files changed, 37 insertions, 19 deletions
diff --git a/fs/ext3/super.c b/fs/ext3/super.c
index 04169318e6ba..0e9cbc37024a 100644
--- a/fs/ext3/super.c
+++ b/fs/ext3/super.c
@@ -143,12 +143,16 @@ void ext3_journal_abort_handle(const char *caller, const char *err_fn,
143void ext3_msg(struct super_block *sb, const char *prefix, 143void ext3_msg(struct super_block *sb, const char *prefix,
144 const char *fmt, ...) 144 const char *fmt, ...)
145{ 145{
146 struct va_format vaf;
146 va_list args; 147 va_list args;
147 148
148 va_start(args, fmt); 149 va_start(args, fmt);
149 printk("%sEXT3-fs (%s): ", prefix, sb->s_id); 150
150 vprintk(fmt, args); 151 vaf.fmt = fmt;
151 printk("\n"); 152 vaf.va = &args;
153
154 printk("%sEXT3-fs (%s): %pV\n", prefix, sb->s_id, &vaf);
155
152 va_end(args); 156 va_end(args);
153} 157}
154 158
@@ -195,15 +199,20 @@ static void ext3_handle_error(struct super_block *sb)
195 sb->s_id); 199 sb->s_id);
196} 200}
197 201
198void ext3_error (struct super_block * sb, const char * function, 202void ext3_error(struct super_block *sb, const char *function,
199 const char * fmt, ...) 203 const char *fmt, ...)
200{ 204{
205 struct va_format vaf;
201 va_list args; 206 va_list args;
202 207
203 va_start(args, fmt); 208 va_start(args, fmt);
204 printk(KERN_CRIT "EXT3-fs error (device %s): %s: ",sb->s_id, function); 209
205 vprintk(fmt, args); 210 vaf.fmt = fmt;
206 printk("\n"); 211 vaf.va = &args;
212
213 printk(KERN_CRIT "EXT3-fs error (device %s): %s: %pV\n",
214 sb->s_id, function, &vaf);
215
207 va_end(args); 216 va_end(args);
208 217
209 ext3_handle_error(sb); 218 ext3_handle_error(sb);
@@ -274,15 +283,20 @@ void __ext3_std_error (struct super_block * sb, const char * function,
274 * case we take the easy way out and panic immediately. 283 * case we take the easy way out and panic immediately.
275 */ 284 */
276 285
277void ext3_abort (struct super_block * sb, const char * function, 286void ext3_abort(struct super_block *sb, const char *function,
278 const char * fmt, ...) 287 const char *fmt, ...)
279{ 288{
289 struct va_format vaf;
280 va_list args; 290 va_list args;
281 291
282 va_start(args, fmt); 292 va_start(args, fmt);
283 printk(KERN_CRIT "EXT3-fs (%s): error: %s: ", sb->s_id, function); 293
284 vprintk(fmt, args); 294 vaf.fmt = fmt;
285 printk("\n"); 295 vaf.va = &args;
296
297 printk(KERN_CRIT "EXT3-fs (%s): error: %s: %pV\n",
298 sb->s_id, function, &vaf);
299
286 va_end(args); 300 va_end(args);
287 301
288 if (test_opt(sb, ERRORS_PANIC)) 302 if (test_opt(sb, ERRORS_PANIC))
@@ -300,16 +314,20 @@ void ext3_abort (struct super_block * sb, const char * function,
300 journal_abort(EXT3_SB(sb)->s_journal, -EIO); 314 journal_abort(EXT3_SB(sb)->s_journal, -EIO);
301} 315}
302 316
303void ext3_warning (struct super_block * sb, const char * function, 317void ext3_warning(struct super_block *sb, const char *function,
304 const char * fmt, ...) 318 const char *fmt, ...)
305{ 319{
320 struct va_format vaf;
306 va_list args; 321 va_list args;
307 322
308 va_start(args, fmt); 323 va_start(args, fmt);
309 printk(KERN_WARNING "EXT3-fs (%s): warning: %s: ", 324
310 sb->s_id, function); 325 vaf.fmt = fmt;
311 vprintk(fmt, args); 326 vaf.va = &args;
312 printk("\n"); 327
328 printk(KERN_WARNING "EXT3-fs (%s): warning: %s: %pV\n",
329 sb->s_id, function, &vaf);
330
313 va_end(args); 331 va_end(args);
314} 332}
315 333