aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ext4/super.c
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@infradead.org>2010-05-19 07:16:40 -0400
committerJan Kara <jack@suse.cz>2010-05-24 08:06:39 -0400
commitc79d967de3741ceb60c5bbbf1b6f97eab9a89838 (patch)
tree5494e7b504cffb0ddc6942d1542c2b4a472207ed /fs/ext4/super.c
parenteea7feb072f5914ecafa95b3d83be0c229244d90 (diff)
quota: move remount handling into the filesystem
Currently do_remount_sb calls into the dquot code to tell it about going from rw to ro and ro to rw. Move this code into the filesystem to not depend on the dquot code in the VFS - note ocfs2 already ignores these calls and handles remount by itself. This gets rid of overloading the quotactl calls and allows to unify the VFS and XFS codepaths in that area later. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Jan Kara <jack@suse.cz>
Diffstat (limited to 'fs/ext4/super.c')
-rw-r--r--fs/ext4/super.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/fs/ext4/super.c b/fs/ext4/super.c
index e14d22c170d5..fb1e191d0fa9 100644
--- a/fs/ext4/super.c
+++ b/fs/ext4/super.c
@@ -3574,6 +3574,7 @@ static int ext4_remount(struct super_block *sb, int *flags, char *data)
3574 ext4_fsblk_t n_blocks_count = 0; 3574 ext4_fsblk_t n_blocks_count = 0;
3575 unsigned long old_sb_flags; 3575 unsigned long old_sb_flags;
3576 struct ext4_mount_options old_opts; 3576 struct ext4_mount_options old_opts;
3577 int enable_quota = 0;
3577 ext4_group_t g; 3578 ext4_group_t g;
3578 unsigned int journal_ioprio = DEFAULT_JOURNAL_IOPRIO; 3579 unsigned int journal_ioprio = DEFAULT_JOURNAL_IOPRIO;
3579 int err; 3580 int err;
@@ -3630,6 +3631,12 @@ static int ext4_remount(struct super_block *sb, int *flags, char *data)
3630 } 3631 }
3631 3632
3632 if (*flags & MS_RDONLY) { 3633 if (*flags & MS_RDONLY) {
3634 err = vfs_dq_off(sb, 1);
3635 if (err < 0 && err != -ENOSYS) {
3636 err = -EBUSY;
3637 goto restore_opts;
3638 }
3639
3633 /* 3640 /*
3634 * First of all, the unconditional stuff we have to do 3641 * First of all, the unconditional stuff we have to do
3635 * to disable replay of the journal when we next remount 3642 * to disable replay of the journal when we next remount
@@ -3698,6 +3705,7 @@ static int ext4_remount(struct super_block *sb, int *flags, char *data)
3698 goto restore_opts; 3705 goto restore_opts;
3699 if (!ext4_setup_super(sb, es, 0)) 3706 if (!ext4_setup_super(sb, es, 0))
3700 sb->s_flags &= ~MS_RDONLY; 3707 sb->s_flags &= ~MS_RDONLY;
3708 enable_quota = 1;
3701 } 3709 }
3702 } 3710 }
3703 ext4_setup_system_zone(sb); 3711 ext4_setup_system_zone(sb);
@@ -3713,6 +3721,8 @@ static int ext4_remount(struct super_block *sb, int *flags, char *data)
3713#endif 3721#endif
3714 unlock_super(sb); 3722 unlock_super(sb);
3715 unlock_kernel(); 3723 unlock_kernel();
3724 if (enable_quota)
3725 vfs_dq_quota_on_remount(sb);
3716 return 0; 3726 return 0;
3717 3727
3718restore_opts: 3728restore_opts: