Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

fs/qnx6: convert printk to pr_foo()

Use current logging functions.

Coalesce formats.

Signed-off-by: Fabian Frederick <fabf@skynet.be>
Cc: Joe Perches <joe@perches.com>
Cc: Kai Bankett <chaosman@ontika.net>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

authored by

Fabian Frederick and committed by
Linus Torvalds
e00d5b5a b6d53b1b

+43 -55
+6 -8
fs/qnx6/dir.c
··· 77 77 if (de->de_size != 0xff) { 78 78 /* error - long filename entries always have size 0xff 79 79 in direntry */ 80 - printk(KERN_ERR "qnx6: invalid direntry size (%i).\n", 81 - de->de_size); 80 + pr_err("qnx6: invalid direntry size (%i).\n", de->de_size); 82 81 return 0; 83 82 } 84 83 lf = qnx6_longname(s, de, &page); 85 84 if (IS_ERR(lf)) { 86 - printk(KERN_ERR "qnx6:Error reading longname\n"); 85 + pr_err("qnx6:Error reading longname\n"); 87 86 return 0; 88 87 } 89 88 ··· 90 91 91 92 if (lf_size > QNX6_LONG_NAME_MAX) { 92 93 QNX6DEBUG((KERN_INFO "file %s\n", lf->lf_fname)); 93 - printk(KERN_ERR "qnx6:Filename too long (%i)\n", lf_size); 94 + pr_err("qnx6:Filename too long (%i)\n", lf_size); 94 95 qnx6_put_page(page); 95 96 return 0; 96 97 } ··· 99 100 mmi 3g filesystem does not have that checksum */ 100 101 if (!test_opt(s, MMI_FS) && fs32_to_cpu(sbi, de->de_checksum) != 101 102 qnx6_lfile_checksum(lf->lf_fname, lf_size)) 102 - printk(KERN_INFO "qnx6: long filename checksum error.\n"); 103 + pr_info("qnx6: long filename checksum error.\n"); 103 104 104 105 QNX6DEBUG((KERN_INFO "qnx6_readdir:%.*s inode:%u\n", 105 106 lf_size, lf->lf_fname, de_inode)); ··· 135 136 int i = start; 136 137 137 138 if (IS_ERR(page)) { 138 - printk(KERN_ERR "qnx6_readdir: read failed\n"); 139 + pr_err("qnx6_readdir: read failed\n"); 139 140 ctx->pos = (n + 1) << PAGE_CACHE_SHIFT; 140 141 return PTR_ERR(page); 141 142 } ··· 258 259 if (ino) 259 260 goto found; 260 261 } else 261 - printk(KERN_ERR "qnx6: undefined " 262 - "filename size in inode.\n"); 262 + pr_err("qnx6: undefined filename size in inode.\n"); 263 263 } 264 264 qnx6_put_page(page); 265 265 }
+27 -35
fs/qnx6/inode.c
··· 87 87 static int qnx6_check_blockptr(__fs32 ptr) 88 88 { 89 89 if (ptr == ~(__fs32)0) { 90 - printk(KERN_ERR "qnx6: hit unused blockpointer.\n"); 90 + pr_err("qnx6: hit unused blockpointer.\n"); 91 91 return 0; 92 92 } 93 93 return 1; ··· 127 127 levelptr = no >> bitdelta; 128 128 129 129 if (levelptr > QNX6_NO_DIRECT_POINTERS - 1) { 130 - printk(KERN_ERR "qnx6:Requested file block number (%u) too big.", 131 - no); 130 + pr_err("qnx6:Requested file block number (%u) too big.", no); 132 131 return 0; 133 132 } 134 133 ··· 136 137 for (i = 0; i < depth; i++) { 137 138 bh = sb_bread(s, block); 138 139 if (!bh) { 139 - printk(KERN_ERR "qnx6:Error reading block (%u)\n", 140 - block); 140 + pr_err("qnx6:Error reading block (%u)\n", block); 141 141 return 0; 142 142 } 143 143 bitdelta -= ptrbits; ··· 275 277 start with the first superblock */ 276 278 bh = sb_bread(s, offset); 277 279 if (!bh) { 278 - printk(KERN_ERR "qnx6: unable to read the first superblock\n"); 280 + pr_err("qnx6: unable to read the first superblock\n"); 279 281 return NULL; 280 282 } 281 283 sb = (struct qnx6_super_block *)bh->b_data; ··· 290 292 sbi->s_bytesex = BYTESEX_LE; 291 293 if (!silent) { 292 294 if (offset == 0) { 293 - printk(KERN_ERR "qnx6: wrong signature (magic)" 294 - " in superblock #1.\n"); 295 + pr_err("qnx6: wrong signature (magic) in superblock #1.\n"); 295 296 } else { 296 - printk(KERN_INFO "qnx6: wrong signature (magic)" 297 - " at position (0x%lx) - will try" 298 - " alternative position (0x0000).\n", 299 - offset * s->s_blocksize); 297 + pr_info("qnx6: wrong signature (magic) at position (0x%lx) - will try alternative position (0x0000).\n", 298 + offset * s->s_blocksize); 300 299 } 301 300 } 302 301 brelse(bh); ··· 324 329 325 330 /* Superblock always is 512 Byte long */ 326 331 if (!sb_set_blocksize(s, QNX6_SUPERBLOCK_SIZE)) { 327 - printk(KERN_ERR "qnx6: unable to set blocksize\n"); 332 + pr_err("qnx6: unable to set blocksize\n"); 328 333 goto outnobh; 329 334 } 330 335 331 336 /* parse the mount-options */ 332 337 if (!qnx6_parse_options((char *) data, s)) { 333 - printk(KERN_ERR "qnx6: invalid mount options.\n"); 338 + pr_err("qnx6: invalid mount options.\n"); 334 339 goto outnobh; 335 340 } 336 341 if (test_opt(s, MMI_FS)) { ··· 350 355 /* try again without bootblock offset */ 351 356 bh1 = qnx6_check_first_superblock(s, 0, silent); 352 357 if (!bh1) { 353 - printk(KERN_ERR "qnx6: unable to read the first superblock\n"); 358 + pr_err("qnx6: unable to read the first superblock\n"); 354 359 goto outnobh; 355 360 } 356 361 /* seems that no bootblock at partition start */ ··· 365 370 /* checksum check - start at byte 8 and end at byte 512 */ 366 371 if (fs32_to_cpu(sbi, sb1->sb_checksum) != 367 372 crc32_be(0, (char *)(bh1->b_data + 8), 504)) { 368 - printk(KERN_ERR "qnx6: superblock #1 checksum error\n"); 373 + pr_err("qnx6: superblock #1 checksum error\n"); 369 374 goto out; 370 375 } 371 376 372 377 /* set new blocksize */ 373 378 if (!sb_set_blocksize(s, fs32_to_cpu(sbi, sb1->sb_blocksize))) { 374 - printk(KERN_ERR "qnx6: unable to set blocksize\n"); 379 + pr_err("qnx6: unable to set blocksize\n"); 375 380 goto out; 376 381 } 377 382 /* blocksize invalidates bh - pull it back in */ ··· 393 398 /* next the second superblock */ 394 399 bh2 = sb_bread(s, offset); 395 400 if (!bh2) { 396 - printk(KERN_ERR "qnx6: unable to read the second superblock\n"); 401 + pr_err("qnx6: unable to read the second superblock\n"); 397 402 goto out; 398 403 } 399 404 sb2 = (struct qnx6_super_block *)bh2->b_data; 400 405 if (fs32_to_cpu(sbi, sb2->sb_magic) != QNX6_SUPER_MAGIC) { 401 406 if (!silent) 402 - printk(KERN_ERR "qnx6: wrong signature (magic)" 403 - " in superblock #2.\n"); 407 + pr_err("qnx6: wrong signature (magic) in superblock #2.\n"); 404 408 goto out; 405 409 } 406 410 407 411 /* checksum check - start at byte 8 and end at byte 512 */ 408 412 if (fs32_to_cpu(sbi, sb2->sb_checksum) != 409 413 crc32_be(0, (char *)(bh2->b_data + 8), 504)) { 410 - printk(KERN_ERR "qnx6: superblock #2 checksum error\n"); 414 + pr_err("qnx6: superblock #2 checksum error\n"); 411 415 goto out; 412 416 } 413 417 ··· 416 422 sbi->sb_buf = bh1; 417 423 sbi->sb = (struct qnx6_super_block *)bh1->b_data; 418 424 brelse(bh2); 419 - printk(KERN_INFO "qnx6: superblock #1 active\n"); 425 + pr_info("qnx6: superblock #1 active\n"); 420 426 } else { 421 427 /* superblock #2 active */ 422 428 sbi->sb_buf = bh2; 423 429 sbi->sb = (struct qnx6_super_block *)bh2->b_data; 424 430 brelse(bh1); 425 - printk(KERN_INFO "qnx6: superblock #2 active\n"); 431 + pr_info("qnx6: superblock #2 active\n"); 426 432 } 427 433 mmi_success: 428 434 /* sanity check - limit maximum indirect pointer levels */ 429 435 if (sb1->Inode.levels > QNX6_PTR_MAX_LEVELS) { 430 - printk(KERN_ERR "qnx6: too many inode levels (max %i, sb %i)\n", 431 - QNX6_PTR_MAX_LEVELS, sb1->Inode.levels); 436 + pr_err("qnx6: too many inode levels (max %i, sb %i)\n", 437 + QNX6_PTR_MAX_LEVELS, sb1->Inode.levels); 432 438 goto out; 433 439 } 434 440 if (sb1->Longfile.levels > QNX6_PTR_MAX_LEVELS) { 435 - printk(KERN_ERR "qnx6: too many longfilename levels" 436 - " (max %i, sb %i)\n", 437 - QNX6_PTR_MAX_LEVELS, sb1->Longfile.levels); 441 + pr_err("qnx6: too many longfilename levels (max %i, sb %i)\n", 442 + QNX6_PTR_MAX_LEVELS, sb1->Longfile.levels); 438 443 goto out; 439 444 } 440 445 s->s_op = &qnx6_sops; ··· 453 460 /* prefetch root inode */ 454 461 root = qnx6_iget(s, QNX6_ROOT_INO); 455 462 if (IS_ERR(root)) { 456 - printk(KERN_ERR "qnx6: get inode failed\n"); 463 + pr_err("qnx6: get inode failed\n"); 457 464 ret = PTR_ERR(root); 458 465 goto out2; 459 466 } ··· 467 474 errmsg = qnx6_checkroot(s); 468 475 if (errmsg != NULL) { 469 476 if (!silent) 470 - printk(KERN_ERR "qnx6: %s\n", errmsg); 477 + pr_err("qnx6: %s\n", errmsg); 471 478 goto out3; 472 479 } 473 480 return 0; ··· 548 555 inode->i_mode = 0; 549 556 550 557 if (ino == 0) { 551 - printk(KERN_ERR "qnx6: bad inode number on dev %s: %u is " 552 - "out of range\n", 558 + pr_err("qnx6: bad inode number on dev %s: %u is out of range\n", 553 559 sb->s_id, ino); 554 560 iget_failed(inode); 555 561 return ERR_PTR(-EIO); ··· 558 566 mapping = sbi->inodes->i_mapping; 559 567 page = read_mapping_page(mapping, n, NULL); 560 568 if (IS_ERR(page)) { 561 - printk(KERN_ERR "qnx6: major problem: unable to read inode from " 562 - "dev %s\n", sb->s_id); 569 + pr_err("qnx6: major problem: unable to read inode from dev %s\n", 570 + sb->s_id); 563 571 iget_failed(inode); 564 572 return ERR_CAST(page); 565 573 } ··· 681 689 return err; 682 690 } 683 691 684 - printk(KERN_INFO "QNX6 filesystem 1.0.0 registered.\n"); 692 + pr_info("QNX6 filesystem 1.0.0 registered.\n"); 685 693 return 0; 686 694 } 687 695
+10 -12
fs/qnx6/super_mmi.c
··· 44 44 start with the first superblock */ 45 45 bh1 = sb_bread(s, 0); 46 46 if (!bh1) { 47 - printk(KERN_ERR "qnx6: Unable to read first mmi superblock\n"); 47 + pr_err("qnx6: Unable to read first mmi superblock\n"); 48 48 return NULL; 49 49 } 50 50 sb1 = (struct qnx6_mmi_super_block *)bh1->b_data; 51 51 sbi = QNX6_SB(s); 52 52 if (fs32_to_cpu(sbi, sb1->sb_magic) != QNX6_SUPER_MAGIC) { 53 53 if (!silent) { 54 - printk(KERN_ERR "qnx6: wrong signature (magic) in" 55 - " superblock #1.\n"); 54 + pr_err("qnx6: wrong signature (magic) in superblock #1.\n"); 56 55 goto out; 57 56 } 58 57 } ··· 59 60 /* checksum check - start at byte 8 and end at byte 512 */ 60 61 if (fs32_to_cpu(sbi, sb1->sb_checksum) != 61 62 crc32_be(0, (char *)(bh1->b_data + 8), 504)) { 62 - printk(KERN_ERR "qnx6: superblock #1 checksum error\n"); 63 + pr_err("qnx6: superblock #1 checksum error\n"); 63 64 goto out; 64 65 } 65 66 ··· 69 70 70 71 /* set new blocksize */ 71 72 if (!sb_set_blocksize(s, fs32_to_cpu(sbi, sb1->sb_blocksize))) { 72 - printk(KERN_ERR "qnx6: unable to set blocksize\n"); 73 + pr_err("qnx6: unable to set blocksize\n"); 73 74 goto out; 74 75 } 75 76 /* blocksize invalidates bh - pull it back in */ ··· 82 83 /* read second superblock */ 83 84 bh2 = sb_bread(s, offset); 84 85 if (!bh2) { 85 - printk(KERN_ERR "qnx6: unable to read the second superblock\n"); 86 + pr_err("qnx6: unable to read the second superblock\n"); 86 87 goto out; 87 88 } 88 89 sb2 = (struct qnx6_mmi_super_block *)bh2->b_data; 89 90 if (fs32_to_cpu(sbi, sb2->sb_magic) != QNX6_SUPER_MAGIC) { 90 91 if (!silent) 91 - printk(KERN_ERR "qnx6: wrong signature (magic) in" 92 - " superblock #2.\n"); 92 + pr_err("qnx6: wrong signature (magic) in superblock #2.\n"); 93 93 goto out; 94 94 } 95 95 96 96 /* checksum check - start at byte 8 and end at byte 512 */ 97 97 if (fs32_to_cpu(sbi, sb2->sb_checksum) 98 98 != crc32_be(0, (char *)(bh2->b_data + 8), 504)) { 99 - printk(KERN_ERR "qnx6: superblock #1 checksum error\n"); 99 + pr_err("qnx6: superblock #1 checksum error\n"); 100 100 goto out; 101 101 } 102 102 103 103 qsb = kmalloc(sizeof(*qsb), GFP_KERNEL); 104 104 if (!qsb) { 105 - printk(KERN_ERR "qnx6: unable to allocate memory.\n"); 105 + pr_err("qnx6: unable to allocate memory.\n"); 106 106 goto out; 107 107 } 108 108 ··· 117 119 sbi->sb_buf = bh1; 118 120 sbi->sb = (struct qnx6_super_block *)bh1->b_data; 119 121 brelse(bh2); 120 - printk(KERN_INFO "qnx6: superblock #1 active\n"); 122 + pr_info("qnx6: superblock #1 active\n"); 121 123 } else { 122 124 /* superblock #2 active */ 123 125 qnx6_mmi_copy_sb(qsb, sb2); ··· 129 131 sbi->sb_buf = bh2; 130 132 sbi->sb = (struct qnx6_super_block *)bh2->b_data; 131 133 brelse(bh1); 132 - printk(KERN_INFO "qnx6: superblock #2 active\n"); 134 + pr_info("qnx6: superblock #2 active\n"); 133 135 } 134 136 kfree(qsb); 135 137