diff options
Diffstat (limited to 'fs/qnx6/inode.c')
-rw-r--r-- | fs/qnx6/inode.c | 44 |
1 files changed, 22 insertions, 22 deletions
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, | |||
87 | static int qnx6_check_blockptr(__fs32 ptr) | 87 | static 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 | } |
427 | mmi_success: | 427 | mmi_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); |