aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ext4
diff options
context:
space:
mode:
authorTheodore Ts'o <tytso@mit.edu>2012-08-17 19:08:42 -0400
committerTheodore Ts'o <tytso@mit.edu>2012-08-17 19:08:42 -0400
commit07724f98978ad39386a3996a4e1b6780489a4dda (patch)
tree76e18d2a8044b73793d6e09cfefaf23c247ced79 /fs/ext4
parent0e376b1e3ccedee49cb8cc6b652fbc1e7c15eeef (diff)
ext4: drop lock_super()/unlock_super()
We don't need lock_super()/unlock_super() any more, since the places where it is used, we are protected by the s_umount r/w semaphore. Signed-off-by: "Theodore Ts'o" <tytso@mit.edu> Cc: Marco Stornelli <marco.stornelli@gmail.com>
Diffstat (limited to 'fs/ext4')
-rw-r--r--fs/ext4/super.c11
1 files changed, 1 insertions, 10 deletions
diff --git a/fs/ext4/super.c b/fs/ext4/super.c
index 3ab798d00f02..bae4124e1473 100644
--- a/fs/ext4/super.c
+++ b/fs/ext4/super.c
@@ -861,7 +861,6 @@ static void ext4_put_super(struct super_block *sb)
861 flush_workqueue(sbi->dio_unwritten_wq); 861 flush_workqueue(sbi->dio_unwritten_wq);
862 destroy_workqueue(sbi->dio_unwritten_wq); 862 destroy_workqueue(sbi->dio_unwritten_wq);
863 863
864 lock_super(sb);
865 if (sbi->s_journal) { 864 if (sbi->s_journal) {
866 err = jbd2_journal_destroy(sbi->s_journal); 865 err = jbd2_journal_destroy(sbi->s_journal);
867 sbi->s_journal = NULL; 866 sbi->s_journal = NULL;
@@ -928,7 +927,6 @@ static void ext4_put_super(struct super_block *sb)
928 * Now that we are completely done shutting down the 927 * Now that we are completely done shutting down the
929 * superblock, we need to actually destroy the kobject. 928 * superblock, we need to actually destroy the kobject.
930 */ 929 */
931 unlock_super(sb);
932 kobject_put(&sbi->s_kobj); 930 kobject_put(&sbi->s_kobj);
933 wait_for_completion(&sbi->s_kobj_unregister); 931 wait_for_completion(&sbi->s_kobj_unregister);
934 if (sbi->s_chksum_driver) 932 if (sbi->s_chksum_driver)
@@ -4535,11 +4533,9 @@ static int ext4_unfreeze(struct super_block *sb)
4535 if (sb->s_flags & MS_RDONLY) 4533 if (sb->s_flags & MS_RDONLY)
4536 return 0; 4534 return 0;
4537 4535
4538 lock_super(sb);
4539 /* Reset the needs_recovery flag before the fs is unlocked. */ 4536 /* Reset the needs_recovery flag before the fs is unlocked. */
4540 EXT4_SET_INCOMPAT_FEATURE(sb, EXT4_FEATURE_INCOMPAT_RECOVER); 4537 EXT4_SET_INCOMPAT_FEATURE(sb, EXT4_FEATURE_INCOMPAT_RECOVER);
4541 ext4_commit_super(sb, 1); 4538 ext4_commit_super(sb, 1);
4542 unlock_super(sb);
4543 return 0; 4539 return 0;
4544} 4540}
4545 4541
@@ -4575,7 +4571,6 @@ static int ext4_remount(struct super_block *sb, int *flags, char *data)
4575 char *orig_data = kstrdup(data, GFP_KERNEL); 4571 char *orig_data = kstrdup(data, GFP_KERNEL);
4576 4572
4577 /* Store the original options */ 4573 /* Store the original options */
4578 lock_super(sb);
4579 old_sb_flags = sb->s_flags; 4574 old_sb_flags = sb->s_flags;
4580 old_opts.s_mount_opt = sbi->s_mount_opt; 4575 old_opts.s_mount_opt = sbi->s_mount_opt;
4581 old_opts.s_mount_opt2 = sbi->s_mount_opt2; 4576 old_opts.s_mount_opt2 = sbi->s_mount_opt2;
@@ -4717,7 +4712,6 @@ static int ext4_remount(struct super_block *sb, int *flags, char *data)
4717 if (sbi->s_journal == NULL) 4712 if (sbi->s_journal == NULL)
4718 ext4_commit_super(sb, 1); 4713 ext4_commit_super(sb, 1);
4719 4714
4720 unlock_super(sb);
4721#ifdef CONFIG_QUOTA 4715#ifdef CONFIG_QUOTA
4722 /* Release old quota file names */ 4716 /* Release old quota file names */
4723 for (i = 0; i < MAXQUOTAS; i++) 4717 for (i = 0; i < MAXQUOTAS; i++)
@@ -4730,10 +4724,8 @@ static int ext4_remount(struct super_block *sb, int *flags, char *data)
4730 else if (EXT4_HAS_RO_COMPAT_FEATURE(sb, 4724 else if (EXT4_HAS_RO_COMPAT_FEATURE(sb,
4731 EXT4_FEATURE_RO_COMPAT_QUOTA)) { 4725 EXT4_FEATURE_RO_COMPAT_QUOTA)) {
4732 err = ext4_enable_quotas(sb); 4726 err = ext4_enable_quotas(sb);
4733 if (err) { 4727 if (err)
4734 lock_super(sb);
4735 goto restore_opts; 4728 goto restore_opts;
4736 }
4737 } 4729 }
4738 } 4730 }
4739#endif 4731#endif
@@ -4760,7 +4752,6 @@ restore_opts:
4760 sbi->s_qf_names[i] = old_opts.s_qf_names[i]; 4752 sbi->s_qf_names[i] = old_opts.s_qf_names[i];
4761 } 4753 }
4762#endif 4754#endif
4763 unlock_super(sb);
4764 kfree(orig_data); 4755 kfree(orig_data);
4765 return err; 4756 return err;
4766} 4757}