diff options
author | Christoph Hellwig <hch@infradead.org> | 2010-05-19 07:16:40 -0400 |
---|---|---|
committer | Jan Kara <jack@suse.cz> | 2010-05-24 14:06:39 +0200 |
commit | c79d967de3741ceb60c5bbbf1b6f97eab9a89838 (patch) | |
tree | 5494e7b504cffb0ddc6942d1542c2b4a472207ed /fs/ext2 | |
parent | eea7feb072f5914ecafa95b3d83be0c229244d90 (diff) | |
download | linux-c79d967de3741ceb60c5bbbf1b6f97eab9a89838.tar.gz linux-c79d967de3741ceb60c5bbbf1b6f97eab9a89838.tar.bz2 linux-c79d967de3741ceb60c5bbbf1b6f97eab9a89838.zip |
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/ext2')
-rw-r--r-- | fs/ext2/super.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/fs/ext2/super.c b/fs/ext2/super.c index 71e9eb1fa696..73346de9af5c 100644 --- a/fs/ext2/super.c +++ b/fs/ext2/super.c @@ -1241,6 +1241,7 @@ static int ext2_remount (struct super_block * sb, int * flags, char * data) spin_unlock(&sbi->s_lock); return 0; } + /* * OK, we are remounting a valid rw partition rdonly, so set * the rdonly flag and then mark the partition as valid again. @@ -1248,6 +1249,14 @@ static int ext2_remount (struct super_block * sb, int * flags, char * data) es->s_state = cpu_to_le16(sbi->s_mount_state); es->s_mtime = cpu_to_le32(get_seconds()); spin_unlock(&sbi->s_lock); + + err = vfs_dq_off(sb, 1); + if (err < 0 && err != -ENOSYS) { + err = -EBUSY; + spin_lock(&sbi->s_lock); + goto restore_opts; + } + ext2_sync_super(sb, es, 1); } else { __le32 ret = EXT2_HAS_RO_COMPAT_FEATURE(sb, @@ -1269,8 +1278,12 @@ static int ext2_remount (struct super_block * sb, int * flags, char * data) if (!ext2_setup_super (sb, es, 0)) sb->s_flags &= ~MS_RDONLY; spin_unlock(&sbi->s_lock); + ext2_write_super(sb); + + vfs_dq_quota_on_remount(sb); } + return 0; restore_opts: sbi->s_mount_opt = old_opts.s_mount_opt; |