aboutsummaryrefslogtreecommitdiffstats
path: root/fs/jfs/super.c
diff options
context:
space:
mode:
authorFabian Frederick <fabf@skynet.be>2014-05-21 20:42:24 -0400
committerDave Kleikamp <dave.kleikamp@oracle.com>2014-06-03 15:13:59 -0400
commit789602e95d5ceb4c08b673fe4b39aa109bc66527 (patch)
treed2ab9b465d071ee9ab1c009a3b4393e3e3869339 /fs/jfs/super.c
parentbc4e6b28ac03c730c79fb45bd8cc19387f44adfa (diff)
fs/jfs/super.c: remove 0 assignment to static + code clean-up
-Static values are automatically initialized to NULL -Coalesce format fragments -Remove unnecessary {} -Small typo fixes -Fix lines > 80 characters Signed-off-by: Fabian Frederick <fabf@skynet.be> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Dave Kleikamp <dave.kleikamp@oracle.com>
Diffstat (limited to 'fs/jfs/super.c')
-rw-r--r--fs/jfs/super.c45
1 files changed, 19 insertions, 26 deletions
diff --git a/fs/jfs/super.c b/fs/jfs/super.c
index 97f7fda51890..d1096fed5a62 100644
--- a/fs/jfs/super.c
+++ b/fs/jfs/super.c
@@ -50,14 +50,14 @@ MODULE_DESCRIPTION("The Journaled Filesystem (JFS)");
50MODULE_AUTHOR("Steve Best/Dave Kleikamp/Barry Arndt, IBM"); 50MODULE_AUTHOR("Steve Best/Dave Kleikamp/Barry Arndt, IBM");
51MODULE_LICENSE("GPL"); 51MODULE_LICENSE("GPL");
52 52
53static struct kmem_cache * jfs_inode_cachep; 53static struct kmem_cache *jfs_inode_cachep;
54 54
55static const struct super_operations jfs_super_operations; 55static const struct super_operations jfs_super_operations;
56static const struct export_operations jfs_export_operations; 56static const struct export_operations jfs_export_operations;
57static struct file_system_type jfs_fs_type; 57static struct file_system_type jfs_fs_type;
58 58
59#define MAX_COMMIT_THREADS 64 59#define MAX_COMMIT_THREADS 64
60static int commit_threads = 0; 60static int commit_threads;
61module_param(commit_threads, int, 0); 61module_param(commit_threads, int, 0);
62MODULE_PARM_DESC(commit_threads, "Number of commit threads"); 62MODULE_PARM_DESC(commit_threads, "Number of commit threads");
63 63
@@ -84,8 +84,7 @@ static void jfs_handle_error(struct super_block *sb)
84 panic("JFS (device %s): panic forced after error\n", 84 panic("JFS (device %s): panic forced after error\n",
85 sb->s_id); 85 sb->s_id);
86 else if (sbi->flag & JFS_ERR_REMOUNT_RO) { 86 else if (sbi->flag & JFS_ERR_REMOUNT_RO) {
87 jfs_err("ERROR: (device %s): remounting filesystem " 87 jfs_err("ERROR: (device %s): remounting filesystem as read-only\n",
88 "as read-only\n",
89 sb->s_id); 88 sb->s_id);
90 sb->s_flags |= MS_RDONLY; 89 sb->s_flags |= MS_RDONLY;
91 } 90 }
@@ -363,12 +362,10 @@ static int parse_options(char *options, struct super_block *sb, s64 *newLVSize,
363 * -> user has more control over the online trimming 362 * -> user has more control over the online trimming
364 */ 363 */
365 sbi->minblks_trim = 64; 364 sbi->minblks_trim = 64;
366 if (blk_queue_discard(q)) { 365 if (blk_queue_discard(q))
367 *flag |= JFS_DISCARD; 366 *flag |= JFS_DISCARD;
368 } else { 367 else
369 pr_err("JFS: discard option " \ 368 pr_err("JFS: discard option not supported on device\n");
370 "not supported on device\n");
371 }
372 break; 369 break;
373 } 370 }
374 371
@@ -385,15 +382,14 @@ static int parse_options(char *options, struct super_block *sb, s64 *newLVSize,
385 sbi->minblks_trim = simple_strtoull( 382 sbi->minblks_trim = simple_strtoull(
386 minblks_trim, &minblks_trim, 0); 383 minblks_trim, &minblks_trim, 0);
387 } else { 384 } else {
388 pr_err("JFS: discard option " \ 385 pr_err("JFS: discard option not supported on device\n");
389 "not supported on device\n");
390 } 386 }
391 break; 387 break;
392 } 388 }
393 389
394 default: 390 default:
395 printk("jfs: Unrecognized mount option \"%s\" " 391 printk("jfs: Unrecognized mount option \"%s\" or missing value\n",
396 " or missing value\n", p); 392 p);
397 goto cleanup; 393 goto cleanup;
398 } 394 }
399 } 395 }
@@ -419,14 +415,12 @@ static int jfs_remount(struct super_block *sb, int *flags, char *data)
419 int ret; 415 int ret;
420 416
421 sync_filesystem(sb); 417 sync_filesystem(sb);
422 if (!parse_options(data, sb, &newLVSize, &flag)) { 418 if (!parse_options(data, sb, &newLVSize, &flag))
423 return -EINVAL; 419 return -EINVAL;
424 }
425 420
426 if (newLVSize) { 421 if (newLVSize) {
427 if (sb->s_flags & MS_RDONLY) { 422 if (sb->s_flags & MS_RDONLY) {
428 pr_err("JFS: resize requires volume" \ 423 pr_err("JFS: resize requires volume to be mounted read-write\n");
429 " to be mounted read-write\n");
430 return -EROFS; 424 return -EROFS;
431 } 425 }
432 rc = jfs_extendfs(sb, newLVSize, 0); 426 rc = jfs_extendfs(sb, newLVSize, 0);
@@ -452,9 +446,8 @@ static int jfs_remount(struct super_block *sb, int *flags, char *data)
452 } 446 }
453 if ((!(sb->s_flags & MS_RDONLY)) && (*flags & MS_RDONLY)) { 447 if ((!(sb->s_flags & MS_RDONLY)) && (*flags & MS_RDONLY)) {
454 rc = dquot_suspend(sb, -1); 448 rc = dquot_suspend(sb, -1);
455 if (rc < 0) { 449 if (rc < 0)
456 return rc; 450 return rc;
457 }
458 rc = jfs_umount_rw(sb); 451 rc = jfs_umount_rw(sb);
459 JFS_SBI(sb)->flag = flag; 452 JFS_SBI(sb)->flag = flag;
460 return rc; 453 return rc;
@@ -487,7 +480,7 @@ static int jfs_fill_super(struct super_block *sb, void *data, int silent)
487 if (!new_valid_dev(sb->s_bdev->bd_dev)) 480 if (!new_valid_dev(sb->s_bdev->bd_dev))
488 return -EOVERFLOW; 481 return -EOVERFLOW;
489 482
490 sbi = kzalloc(sizeof (struct jfs_sb_info), GFP_KERNEL); 483 sbi = kzalloc(sizeof(struct jfs_sb_info), GFP_KERNEL);
491 if (!sbi) 484 if (!sbi)
492 return -ENOMEM; 485 return -ENOMEM;
493 486
@@ -548,9 +541,8 @@ static int jfs_fill_super(struct super_block *sb, void *data, int silent)
548 541
549 rc = jfs_mount(sb); 542 rc = jfs_mount(sb);
550 if (rc) { 543 if (rc) {
551 if (!silent) { 544 if (!silent)
552 jfs_err("jfs_mount failed w/return code = %d", rc); 545 jfs_err("jfs_mount failed w/return code = %d", rc);
553 }
554 goto out_mount_failed; 546 goto out_mount_failed;
555 } 547 }
556 if (sb->s_flags & MS_RDONLY) 548 if (sb->s_flags & MS_RDONLY)
@@ -587,7 +579,8 @@ static int jfs_fill_super(struct super_block *sb, void *data, int silent)
587 * Page cache is indexed by long. 579 * Page cache is indexed by long.
588 * I would use MAX_LFS_FILESIZE, but it's only half as big 580 * I would use MAX_LFS_FILESIZE, but it's only half as big
589 */ 581 */
590 sb->s_maxbytes = min(((u64) PAGE_CACHE_SIZE << 32) - 1, (u64)sb->s_maxbytes); 582 sb->s_maxbytes = min(((u64) PAGE_CACHE_SIZE << 32) - 1,
583 (u64)sb->s_maxbytes);
591#endif 584#endif
592 sb->s_time_gran = 1; 585 sb->s_time_gran = 1;
593 return 0; 586 return 0;
@@ -597,9 +590,8 @@ out_no_root:
597 590
598out_no_rw: 591out_no_rw:
599 rc = jfs_umount(sb); 592 rc = jfs_umount(sb);
600 if (rc) { 593 if (rc)
601 jfs_err("jfs_umount failed with return code %d", rc); 594 jfs_err("jfs_umount failed with return code %d", rc);
602 }
603out_mount_failed: 595out_mount_failed:
604 filemap_write_and_wait(sbi->direct_inode->i_mapping); 596 filemap_write_and_wait(sbi->direct_inode->i_mapping);
605 truncate_inode_pages(sbi->direct_inode->i_mapping, 0); 597 truncate_inode_pages(sbi->direct_inode->i_mapping, 0);
@@ -924,7 +916,8 @@ static int __init init_jfs_fs(void)
924 commit_threads = MAX_COMMIT_THREADS; 916 commit_threads = MAX_COMMIT_THREADS;
925 917
926 for (i = 0; i < commit_threads; i++) { 918 for (i = 0; i < commit_threads; i++) {
927 jfsCommitThread[i] = kthread_run(jfs_lazycommit, NULL, "jfsCommit"); 919 jfsCommitThread[i] = kthread_run(jfs_lazycommit, NULL,
920 "jfsCommit");
928 if (IS_ERR(jfsCommitThread[i])) { 921 if (IS_ERR(jfsCommitThread[i])) {
929 rc = PTR_ERR(jfsCommitThread[i]); 922 rc = PTR_ERR(jfsCommitThread[i]);
930 jfs_err("init_jfs_fs: fork failed w/rc = %d", rc); 923 jfs_err("init_jfs_fs: fork failed w/rc = %d", rc);