aboutsummaryrefslogtreecommitdiffstats
path: root/fs/qnx6
diff options
context:
space:
mode:
authorFabian Frederick <fabf@skynet.be>2014-08-08 17:23:05 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2014-08-08 18:57:26 -0400
commite6c3261653a22f7481791e02fe19d11faac214fb (patch)
tree56f3364872d18d23495b73de55f3037dd56cb803 /fs/qnx6
parente00d5b5ad70c6c4fb978fe843c0bbb3294d63223 (diff)
fs/qnx6: use pr_fmt and __func__ in logging
Remove "qnx6:" and "qnx6: " from each logging instruction. 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>
Diffstat (limited to 'fs/qnx6')
-rw-r--r--fs/qnx6/dir.c12
-rw-r--r--fs/qnx6/inode.c44
-rw-r--r--fs/qnx6/qnx6.h6
-rw-r--r--fs/qnx6/super_mmi.c20
4 files changed, 44 insertions, 38 deletions
diff --git a/fs/qnx6/dir.c b/fs/qnx6/dir.c
index 2289ea180d44..c78a3397c5a9 100644
--- a/fs/qnx6/dir.c
+++ b/fs/qnx6/dir.c
@@ -77,12 +77,12 @@ static int qnx6_dir_longfilename(struct inode *inode,
77 if (de->de_size != 0xff) { 77 if (de->de_size != 0xff) {
78 /* error - long filename entries always have size 0xff 78 /* error - long filename entries always have size 0xff
79 in direntry */ 79 in direntry */
80 pr_err("qnx6: invalid direntry size (%i).\n", de->de_size); 80 pr_err("invalid direntry size (%i).\n", de->de_size);
81 return 0; 81 return 0;
82 } 82 }
83 lf = qnx6_longname(s, de, &page); 83 lf = qnx6_longname(s, de, &page);
84 if (IS_ERR(lf)) { 84 if (IS_ERR(lf)) {
85 pr_err("qnx6:Error reading longname\n"); 85 pr_err("Error reading longname\n");
86 return 0; 86 return 0;
87 } 87 }
88 88
@@ -90,7 +90,7 @@ static int qnx6_dir_longfilename(struct inode *inode,
90 90
91 if (lf_size > QNX6_LONG_NAME_MAX) { 91 if (lf_size > QNX6_LONG_NAME_MAX) {
92 QNX6DEBUG((KERN_INFO "file %s\n", lf->lf_fname)); 92 QNX6DEBUG((KERN_INFO "file %s\n", lf->lf_fname));
93 pr_err("qnx6:Filename too long (%i)\n", lf_size); 93 pr_err("Filename too long (%i)\n", lf_size);
94 qnx6_put_page(page); 94 qnx6_put_page(page);
95 return 0; 95 return 0;
96 } 96 }
@@ -99,7 +99,7 @@ static int qnx6_dir_longfilename(struct inode *inode,
99 mmi 3g filesystem does not have that checksum */ 99 mmi 3g filesystem does not have that checksum */
100 if (!test_opt(s, MMI_FS) && fs32_to_cpu(sbi, de->de_checksum) != 100 if (!test_opt(s, MMI_FS) && fs32_to_cpu(sbi, de->de_checksum) !=
101 qnx6_lfile_checksum(lf->lf_fname, lf_size)) 101 qnx6_lfile_checksum(lf->lf_fname, lf_size))
102 pr_info("qnx6: long filename checksum error.\n"); 102 pr_info("long filename checksum error.\n");
103 103
104 QNX6DEBUG((KERN_INFO "qnx6_readdir:%.*s inode:%u\n", 104 QNX6DEBUG((KERN_INFO "qnx6_readdir:%.*s inode:%u\n",
105 lf_size, lf->lf_fname, de_inode)); 105 lf_size, lf->lf_fname, de_inode));
@@ -135,7 +135,7 @@ static int qnx6_readdir(struct file *file, struct dir_context *ctx)
135 int i = start; 135 int i = start;
136 136
137 if (IS_ERR(page)) { 137 if (IS_ERR(page)) {
138 pr_err("qnx6_readdir: read failed\n"); 138 pr_err("%s(): read failed\n", __func__);
139 ctx->pos = (n + 1) << PAGE_CACHE_SHIFT; 139 ctx->pos = (n + 1) << PAGE_CACHE_SHIFT;
140 return PTR_ERR(page); 140 return PTR_ERR(page);
141 } 141 }
@@ -258,7 +258,7 @@ unsigned qnx6_find_entry(int len, struct inode *dir, const char *name,
258 if (ino) 258 if (ino)
259 goto found; 259 goto found;
260 } else 260 } else
261 pr_err("qnx6: undefined filename size in inode.\n"); 261 pr_err("undefined filename size in inode.\n");
262 } 262 }
263 qnx6_put_page(page); 263 qnx6_put_page(page);
264 } 264 }
diff --git a/fs/qnx6/inode.c b/fs/qnx6/inode.c
index 0042af9a607c..1652e8b99594 100644
--- a/fs/qnx6/inode.c
+++ b/fs/qnx6/inode.c
@@ -87,7 +87,7 @@ static int qnx6_get_block(struct inode *inode, sector_t iblock,
87static int qnx6_check_blockptr(__fs32 ptr) 87static int qnx6_check_blockptr(__fs32 ptr)
88{ 88{
89 if (ptr == ~(__fs32)0) { 89 if (ptr == ~(__fs32)0) {
90 pr_err("qnx6: hit unused blockpointer.\n"); 90 pr_err("hit unused blockpointer.\n");
91 return 0; 91 return 0;
92 } 92 }
93 return 1; 93 return 1;
@@ -127,7 +127,7 @@ static unsigned qnx6_block_map(struct inode *inode, unsigned no)
127 levelptr = no >> bitdelta; 127 levelptr = no >> bitdelta;
128 128
129 if (levelptr > QNX6_NO_DIRECT_POINTERS - 1) { 129 if (levelptr > QNX6_NO_DIRECT_POINTERS - 1) {
130 pr_err("qnx6:Requested file block number (%u) too big.", no); 130 pr_err("Requested file block number (%u) too big.", no);
131 return 0; 131 return 0;
132 } 132 }
133 133
@@ -136,7 +136,7 @@ static unsigned qnx6_block_map(struct inode *inode, unsigned no)
136 for (i = 0; i < depth; i++) { 136 for (i = 0; i < depth; i++) {
137 bh = sb_bread(s, block); 137 bh = sb_bread(s, block);
138 if (!bh) { 138 if (!bh) {
139 pr_err("qnx6:Error reading block (%u)\n", block); 139 pr_err("Error reading block (%u)\n", block);
140 return 0; 140 return 0;
141 } 141 }
142 bitdelta -= ptrbits; 142 bitdelta -= ptrbits;
@@ -275,7 +275,7 @@ static struct buffer_head *qnx6_check_first_superblock(struct super_block *s,
275 start with the first superblock */ 275 start with the first superblock */
276 bh = sb_bread(s, offset); 276 bh = sb_bread(s, offset);
277 if (!bh) { 277 if (!bh) {
278 pr_err("qnx6: unable to read the first superblock\n"); 278 pr_err("unable to read the first superblock\n");
279 return NULL; 279 return NULL;
280 } 280 }
281 sb = (struct qnx6_super_block *)bh->b_data; 281 sb = (struct qnx6_super_block *)bh->b_data;
@@ -290,9 +290,9 @@ static struct buffer_head *qnx6_check_first_superblock(struct super_block *s,
290 sbi->s_bytesex = BYTESEX_LE; 290 sbi->s_bytesex = BYTESEX_LE;
291 if (!silent) { 291 if (!silent) {
292 if (offset == 0) { 292 if (offset == 0) {
293 pr_err("qnx6: wrong signature (magic) in superblock #1.\n"); 293 pr_err("wrong signature (magic) in superblock #1.\n");
294 } else { 294 } else {
295 pr_info("qnx6: wrong signature (magic) at position (0x%lx) - will try alternative position (0x0000).\n", 295 pr_info("wrong signature (magic) at position (0x%lx) - will try alternative position (0x0000).\n",
296 offset * s->s_blocksize); 296 offset * s->s_blocksize);
297 } 297 }
298 } 298 }
@@ -324,13 +324,13 @@ static int qnx6_fill_super(struct super_block *s, void *data, int silent)
324 324
325 /* Superblock always is 512 Byte long */ 325 /* Superblock always is 512 Byte long */
326 if (!sb_set_blocksize(s, QNX6_SUPERBLOCK_SIZE)) { 326 if (!sb_set_blocksize(s, QNX6_SUPERBLOCK_SIZE)) {
327 pr_err("qnx6: unable to set blocksize\n"); 327 pr_err("unable to set blocksize\n");
328 goto outnobh; 328 goto outnobh;
329 } 329 }
330 330
331 /* parse the mount-options */ 331 /* parse the mount-options */
332 if (!qnx6_parse_options((char *) data, s)) { 332 if (!qnx6_parse_options((char *) data, s)) {
333 pr_err("qnx6: invalid mount options.\n"); 333 pr_err("invalid mount options.\n");
334 goto outnobh; 334 goto outnobh;
335 } 335 }
336 if (test_opt(s, MMI_FS)) { 336 if (test_opt(s, MMI_FS)) {
@@ -350,7 +350,7 @@ static int qnx6_fill_super(struct super_block *s, void *data, int silent)
350 /* try again without bootblock offset */ 350 /* try again without bootblock offset */
351 bh1 = qnx6_check_first_superblock(s, 0, silent); 351 bh1 = qnx6_check_first_superblock(s, 0, silent);
352 if (!bh1) { 352 if (!bh1) {
353 pr_err("qnx6: unable to read the first superblock\n"); 353 pr_err("unable to read the first superblock\n");
354 goto outnobh; 354 goto outnobh;
355 } 355 }
356 /* seems that no bootblock at partition start */ 356 /* seems that no bootblock at partition start */
@@ -365,13 +365,13 @@ static int qnx6_fill_super(struct super_block *s, void *data, int silent)
365 /* checksum check - start at byte 8 and end at byte 512 */ 365 /* checksum check - start at byte 8 and end at byte 512 */
366 if (fs32_to_cpu(sbi, sb1->sb_checksum) != 366 if (fs32_to_cpu(sbi, sb1->sb_checksum) !=
367 crc32_be(0, (char *)(bh1->b_data + 8), 504)) { 367 crc32_be(0, (char *)(bh1->b_data + 8), 504)) {
368 pr_err("qnx6: superblock #1 checksum error\n"); 368 pr_err("superblock #1 checksum error\n");
369 goto out; 369 goto out;
370 } 370 }
371 371
372 /* set new blocksize */ 372 /* set new blocksize */
373 if (!sb_set_blocksize(s, fs32_to_cpu(sbi, sb1->sb_blocksize))) { 373 if (!sb_set_blocksize(s, fs32_to_cpu(sbi, sb1->sb_blocksize))) {
374 pr_err("qnx6: unable to set blocksize\n"); 374 pr_err("unable to set blocksize\n");
375 goto out; 375 goto out;
376 } 376 }
377 /* blocksize invalidates bh - pull it back in */ 377 /* blocksize invalidates bh - pull it back in */
@@ -393,20 +393,20 @@ static int qnx6_fill_super(struct super_block *s, void *data, int silent)
393 /* next the second superblock */ 393 /* next the second superblock */
394 bh2 = sb_bread(s, offset); 394 bh2 = sb_bread(s, offset);
395 if (!bh2) { 395 if (!bh2) {
396 pr_err("qnx6: unable to read the second superblock\n"); 396 pr_err("unable to read the second superblock\n");
397 goto out; 397 goto out;
398 } 398 }
399 sb2 = (struct qnx6_super_block *)bh2->b_data; 399 sb2 = (struct qnx6_super_block *)bh2->b_data;
400 if (fs32_to_cpu(sbi, sb2->sb_magic) != QNX6_SUPER_MAGIC) { 400 if (fs32_to_cpu(sbi, sb2->sb_magic) != QNX6_SUPER_MAGIC) {
401 if (!silent) 401 if (!silent)
402 pr_err("qnx6: wrong signature (magic) in superblock #2.\n"); 402 pr_err("wrong signature (magic) in superblock #2.\n");
403 goto out; 403 goto out;
404 } 404 }
405 405
406 /* checksum check - start at byte 8 and end at byte 512 */ 406 /* checksum check - start at byte 8 and end at byte 512 */
407 if (fs32_to_cpu(sbi, sb2->sb_checksum) != 407 if (fs32_to_cpu(sbi, sb2->sb_checksum) !=
408 crc32_be(0, (char *)(bh2->b_data + 8), 504)) { 408 crc32_be(0, (char *)(bh2->b_data + 8), 504)) {
409 pr_err("qnx6: superblock #2 checksum error\n"); 409 pr_err("superblock #2 checksum error\n");
410 goto out; 410 goto out;
411 } 411 }
412 412
@@ -416,23 +416,23 @@ static int qnx6_fill_super(struct super_block *s, void *data, int silent)
416 sbi->sb_buf = bh1; 416 sbi->sb_buf = bh1;
417 sbi->sb = (struct qnx6_super_block *)bh1->b_data; 417 sbi->sb = (struct qnx6_super_block *)bh1->b_data;
418 brelse(bh2); 418 brelse(bh2);
419 pr_info("qnx6: superblock #1 active\n"); 419 pr_info("superblock #1 active\n");
420 } else { 420 } else {
421 /* superblock #2 active */ 421 /* superblock #2 active */
422 sbi->sb_buf = bh2; 422 sbi->sb_buf = bh2;
423 sbi->sb = (struct qnx6_super_block *)bh2->b_data; 423 sbi->sb = (struct qnx6_super_block *)bh2->b_data;
424 brelse(bh1); 424 brelse(bh1);
425 pr_info("qnx6: superblock #2 active\n"); 425 pr_info("superblock #2 active\n");
426 } 426 }
427mmi_success: 427mmi_success:
428 /* sanity check - limit maximum indirect pointer levels */ 428 /* sanity check - limit maximum indirect pointer levels */
429 if (sb1->Inode.levels > QNX6_PTR_MAX_LEVELS) { 429 if (sb1->Inode.levels > QNX6_PTR_MAX_LEVELS) {
430 pr_err("qnx6: too many inode levels (max %i, sb %i)\n", 430 pr_err("too many inode levels (max %i, sb %i)\n",
431 QNX6_PTR_MAX_LEVELS, sb1->Inode.levels); 431 QNX6_PTR_MAX_LEVELS, sb1->Inode.levels);
432 goto out; 432 goto out;
433 } 433 }
434 if (sb1->Longfile.levels > QNX6_PTR_MAX_LEVELS) { 434 if (sb1->Longfile.levels > QNX6_PTR_MAX_LEVELS) {
435 pr_err("qnx6: too many longfilename levels (max %i, sb %i)\n", 435 pr_err("too many longfilename levels (max %i, sb %i)\n",
436 QNX6_PTR_MAX_LEVELS, sb1->Longfile.levels); 436 QNX6_PTR_MAX_LEVELS, sb1->Longfile.levels);
437 goto out; 437 goto out;
438 } 438 }
@@ -453,7 +453,7 @@ mmi_success:
453 /* prefetch root inode */ 453 /* prefetch root inode */
454 root = qnx6_iget(s, QNX6_ROOT_INO); 454 root = qnx6_iget(s, QNX6_ROOT_INO);
455 if (IS_ERR(root)) { 455 if (IS_ERR(root)) {
456 pr_err("qnx6: get inode failed\n"); 456 pr_err("get inode failed\n");
457 ret = PTR_ERR(root); 457 ret = PTR_ERR(root);
458 goto out2; 458 goto out2;
459 } 459 }
@@ -467,7 +467,7 @@ mmi_success:
467 errmsg = qnx6_checkroot(s); 467 errmsg = qnx6_checkroot(s);
468 if (errmsg != NULL) { 468 if (errmsg != NULL) {
469 if (!silent) 469 if (!silent)
470 pr_err("qnx6: %s\n", errmsg); 470 pr_err("%s\n", errmsg);
471 goto out3; 471 goto out3;
472 } 472 }
473 return 0; 473 return 0;
@@ -548,7 +548,7 @@ struct inode *qnx6_iget(struct super_block *sb, unsigned ino)
548 inode->i_mode = 0; 548 inode->i_mode = 0;
549 549
550 if (ino == 0) { 550 if (ino == 0) {
551 pr_err("qnx6: bad inode number on dev %s: %u is out of range\n", 551 pr_err("bad inode number on dev %s: %u is out of range\n",
552 sb->s_id, ino); 552 sb->s_id, ino);
553 iget_failed(inode); 553 iget_failed(inode);
554 return ERR_PTR(-EIO); 554 return ERR_PTR(-EIO);
@@ -558,7 +558,7 @@ struct inode *qnx6_iget(struct super_block *sb, unsigned ino)
558 mapping = sbi->inodes->i_mapping; 558 mapping = sbi->inodes->i_mapping;
559 page = read_mapping_page(mapping, n, NULL); 559 page = read_mapping_page(mapping, n, NULL);
560 if (IS_ERR(page)) { 560 if (IS_ERR(page)) {
561 pr_err("qnx6: major problem: unable to read inode from dev %s\n", 561 pr_err("major problem: unable to read inode from dev %s\n",
562 sb->s_id); 562 sb->s_id);
563 iget_failed(inode); 563 iget_failed(inode);
564 return ERR_CAST(page); 564 return ERR_CAST(page);
diff --git a/fs/qnx6/qnx6.h b/fs/qnx6/qnx6.h
index b00fcc960d37..b0aceda59c36 100644
--- a/fs/qnx6/qnx6.h
+++ b/fs/qnx6/qnx6.h
@@ -10,6 +10,12 @@
10 * 10 *
11 */ 11 */
12 12
13#ifdef pr_fmt
14#undef pr_fmt
15#endif
16
17#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
18
13#include <linux/fs.h> 19#include <linux/fs.h>
14#include <linux/pagemap.h> 20#include <linux/pagemap.h>
15 21
diff --git a/fs/qnx6/super_mmi.c b/fs/qnx6/super_mmi.c
index 8e056b0706ef..62aaf3e3126a 100644
--- a/fs/qnx6/super_mmi.c
+++ b/fs/qnx6/super_mmi.c
@@ -44,14 +44,14 @@ struct qnx6_super_block *qnx6_mmi_fill_super(struct super_block *s, int silent)
44 start with the first superblock */ 44 start with the first superblock */
45 bh1 = sb_bread(s, 0); 45 bh1 = sb_bread(s, 0);
46 if (!bh1) { 46 if (!bh1) {
47 pr_err("qnx6: Unable to read first mmi superblock\n"); 47 pr_err("Unable to read first mmi superblock\n");
48 return NULL; 48 return NULL;
49 } 49 }
50 sb1 = (struct qnx6_mmi_super_block *)bh1->b_data; 50 sb1 = (struct qnx6_mmi_super_block *)bh1->b_data;
51 sbi = QNX6_SB(s); 51 sbi = QNX6_SB(s);
52 if (fs32_to_cpu(sbi, sb1->sb_magic) != QNX6_SUPER_MAGIC) { 52 if (fs32_to_cpu(sbi, sb1->sb_magic) != QNX6_SUPER_MAGIC) {
53 if (!silent) { 53 if (!silent) {
54 pr_err("qnx6: wrong signature (magic) in superblock #1.\n"); 54 pr_err("wrong signature (magic) in superblock #1.\n");
55 goto out; 55 goto out;
56 } 56 }
57 } 57 }
@@ -59,7 +59,7 @@ struct qnx6_super_block *qnx6_mmi_fill_super(struct super_block *s, int silent)
59 /* checksum check - start at byte 8 and end at byte 512 */ 59 /* checksum check - start at byte 8 and end at byte 512 */
60 if (fs32_to_cpu(sbi, sb1->sb_checksum) != 60 if (fs32_to_cpu(sbi, sb1->sb_checksum) !=
61 crc32_be(0, (char *)(bh1->b_data + 8), 504)) { 61 crc32_be(0, (char *)(bh1->b_data + 8), 504)) {
62 pr_err("qnx6: superblock #1 checksum error\n"); 62 pr_err("superblock #1 checksum error\n");
63 goto out; 63 goto out;
64 } 64 }
65 65
@@ -69,7 +69,7 @@ struct qnx6_super_block *qnx6_mmi_fill_super(struct super_block *s, int silent)
69 69
70 /* set new blocksize */ 70 /* set new blocksize */
71 if (!sb_set_blocksize(s, fs32_to_cpu(sbi, sb1->sb_blocksize))) { 71 if (!sb_set_blocksize(s, fs32_to_cpu(sbi, sb1->sb_blocksize))) {
72 pr_err("qnx6: unable to set blocksize\n"); 72 pr_err("unable to set blocksize\n");
73 goto out; 73 goto out;
74 } 74 }
75 /* blocksize invalidates bh - pull it back in */ 75 /* blocksize invalidates bh - pull it back in */
@@ -82,26 +82,26 @@ struct qnx6_super_block *qnx6_mmi_fill_super(struct super_block *s, int silent)
82 /* read second superblock */ 82 /* read second superblock */
83 bh2 = sb_bread(s, offset); 83 bh2 = sb_bread(s, offset);
84 if (!bh2) { 84 if (!bh2) {
85 pr_err("qnx6: unable to read the second superblock\n"); 85 pr_err("unable to read the second superblock\n");
86 goto out; 86 goto out;
87 } 87 }
88 sb2 = (struct qnx6_mmi_super_block *)bh2->b_data; 88 sb2 = (struct qnx6_mmi_super_block *)bh2->b_data;
89 if (fs32_to_cpu(sbi, sb2->sb_magic) != QNX6_SUPER_MAGIC) { 89 if (fs32_to_cpu(sbi, sb2->sb_magic) != QNX6_SUPER_MAGIC) {
90 if (!silent) 90 if (!silent)
91 pr_err("qnx6: wrong signature (magic) in superblock #2.\n"); 91 pr_err("wrong signature (magic) in superblock #2.\n");
92 goto out; 92 goto out;
93 } 93 }
94 94
95 /* checksum check - start at byte 8 and end at byte 512 */ 95 /* checksum check - start at byte 8 and end at byte 512 */
96 if (fs32_to_cpu(sbi, sb2->sb_checksum) 96 if (fs32_to_cpu(sbi, sb2->sb_checksum)
97 != crc32_be(0, (char *)(bh2->b_data + 8), 504)) { 97 != crc32_be(0, (char *)(bh2->b_data + 8), 504)) {
98 pr_err("qnx6: superblock #1 checksum error\n"); 98 pr_err("superblock #1 checksum error\n");
99 goto out; 99 goto out;
100 } 100 }
101 101
102 qsb = kmalloc(sizeof(*qsb), GFP_KERNEL); 102 qsb = kmalloc(sizeof(*qsb), GFP_KERNEL);
103 if (!qsb) { 103 if (!qsb) {
104 pr_err("qnx6: unable to allocate memory.\n"); 104 pr_err("unable to allocate memory.\n");
105 goto out; 105 goto out;
106 } 106 }
107 107
@@ -117,7 +117,7 @@ struct qnx6_super_block *qnx6_mmi_fill_super(struct super_block *s, int silent)
117 sbi->sb_buf = bh1; 117 sbi->sb_buf = bh1;
118 sbi->sb = (struct qnx6_super_block *)bh1->b_data; 118 sbi->sb = (struct qnx6_super_block *)bh1->b_data;
119 brelse(bh2); 119 brelse(bh2);
120 pr_info("qnx6: superblock #1 active\n"); 120 pr_info("superblock #1 active\n");
121 } else { 121 } else {
122 /* superblock #2 active */ 122 /* superblock #2 active */
123 qnx6_mmi_copy_sb(qsb, sb2); 123 qnx6_mmi_copy_sb(qsb, sb2);
@@ -129,7 +129,7 @@ struct qnx6_super_block *qnx6_mmi_fill_super(struct super_block *s, int silent)
129 sbi->sb_buf = bh2; 129 sbi->sb_buf = bh2;
130 sbi->sb = (struct qnx6_super_block *)bh2->b_data; 130 sbi->sb = (struct qnx6_super_block *)bh2->b_data;
131 brelse(bh1); 131 brelse(bh1);
132 pr_info("qnx6: superblock #2 active\n"); 132 pr_info("superblock #2 active\n");
133 } 133 }
134 kfree(qsb); 134 kfree(qsb);
135 135