diff options
Diffstat (limited to 'fs')
-rw-r--r-- | fs/ext3/super.c | 9 | ||||
-rw-r--r-- | fs/ext4/super.c | 9 | ||||
-rw-r--r-- | fs/ocfs2/super.c | 10 | ||||
-rw-r--r-- | fs/quota/dquot.c | 8 | ||||
-rw-r--r-- | fs/quota/quota.c | 4 | ||||
-rw-r--r-- | fs/reiserfs/super.c | 10 |
6 files changed, 16 insertions, 34 deletions
diff --git a/fs/ext3/super.c b/fs/ext3/super.c index b2f3715988ba..e52006737b4b 100644 --- a/fs/ext3/super.c +++ b/fs/ext3/super.c | |||
@@ -750,7 +750,7 @@ static int ext3_release_dquot(struct dquot *dquot); | |||
750 | static int ext3_mark_dquot_dirty(struct dquot *dquot); | 750 | static int ext3_mark_dquot_dirty(struct dquot *dquot); |
751 | static int ext3_write_info(struct super_block *sb, int type); | 751 | static int ext3_write_info(struct super_block *sb, int type); |
752 | static int ext3_quota_on(struct super_block *sb, int type, int format_id, | 752 | static int ext3_quota_on(struct super_block *sb, int type, int format_id, |
753 | char *path, int remount); | 753 | char *path); |
754 | static int ext3_quota_on_mount(struct super_block *sb, int type); | 754 | static int ext3_quota_on_mount(struct super_block *sb, int type); |
755 | static ssize_t ext3_quota_read(struct super_block *sb, int type, char *data, | 755 | static ssize_t ext3_quota_read(struct super_block *sb, int type, char *data, |
756 | size_t len, loff_t off); | 756 | size_t len, loff_t off); |
@@ -1529,7 +1529,7 @@ static void ext3_orphan_cleanup (struct super_block * sb, | |||
1529 | /* Turn quotas off */ | 1529 | /* Turn quotas off */ |
1530 | for (i = 0; i < MAXQUOTAS; i++) { | 1530 | for (i = 0; i < MAXQUOTAS; i++) { |
1531 | if (sb_dqopt(sb)->files[i]) | 1531 | if (sb_dqopt(sb)->files[i]) |
1532 | vfs_quota_off(sb, i, 0); | 1532 | vfs_quota_off(sb, i); |
1533 | } | 1533 | } |
1534 | #endif | 1534 | #endif |
1535 | sb->s_flags = s_flags; /* Restore MS_RDONLY status */ | 1535 | sb->s_flags = s_flags; /* Restore MS_RDONLY status */ |
@@ -2870,16 +2870,13 @@ static int ext3_quota_on_mount(struct super_block *sb, int type) | |||
2870 | * Standard function to be called on quota_on | 2870 | * Standard function to be called on quota_on |
2871 | */ | 2871 | */ |
2872 | static int ext3_quota_on(struct super_block *sb, int type, int format_id, | 2872 | static int ext3_quota_on(struct super_block *sb, int type, int format_id, |
2873 | char *name, int remount) | 2873 | char *name) |
2874 | { | 2874 | { |
2875 | int err; | 2875 | int err; |
2876 | struct path path; | 2876 | struct path path; |
2877 | 2877 | ||
2878 | if (!test_opt(sb, QUOTA)) | 2878 | if (!test_opt(sb, QUOTA)) |
2879 | return -EINVAL; | 2879 | return -EINVAL; |
2880 | /* When remounting, no checks are needed and in fact, name is NULL */ | ||
2881 | if (remount) | ||
2882 | return vfs_quota_on(sb, type, format_id, name, remount); | ||
2883 | 2880 | ||
2884 | err = kern_path(name, LOOKUP_FOLLOW, &path); | 2881 | err = kern_path(name, LOOKUP_FOLLOW, &path); |
2885 | if (err) | 2882 | if (err) |
diff --git a/fs/ext4/super.c b/fs/ext4/super.c index 808aca3a22f5..dfe9bf503f85 100644 --- a/fs/ext4/super.c +++ b/fs/ext4/super.c | |||
@@ -1061,7 +1061,7 @@ static int ext4_release_dquot(struct dquot *dquot); | |||
1061 | static int ext4_mark_dquot_dirty(struct dquot *dquot); | 1061 | static int ext4_mark_dquot_dirty(struct dquot *dquot); |
1062 | static int ext4_write_info(struct super_block *sb, int type); | 1062 | static int ext4_write_info(struct super_block *sb, int type); |
1063 | static int ext4_quota_on(struct super_block *sb, int type, int format_id, | 1063 | static int ext4_quota_on(struct super_block *sb, int type, int format_id, |
1064 | char *path, int remount); | 1064 | char *path); |
1065 | static int ext4_quota_on_mount(struct super_block *sb, int type); | 1065 | static int ext4_quota_on_mount(struct super_block *sb, int type); |
1066 | static ssize_t ext4_quota_read(struct super_block *sb, int type, char *data, | 1066 | static ssize_t ext4_quota_read(struct super_block *sb, int type, char *data, |
1067 | size_t len, loff_t off); | 1067 | size_t len, loff_t off); |
@@ -2053,7 +2053,7 @@ static void ext4_orphan_cleanup(struct super_block *sb, | |||
2053 | /* Turn quotas off */ | 2053 | /* Turn quotas off */ |
2054 | for (i = 0; i < MAXQUOTAS; i++) { | 2054 | for (i = 0; i < MAXQUOTAS; i++) { |
2055 | if (sb_dqopt(sb)->files[i]) | 2055 | if (sb_dqopt(sb)->files[i]) |
2056 | vfs_quota_off(sb, i, 0); | 2056 | vfs_quota_off(sb, i); |
2057 | } | 2057 | } |
2058 | #endif | 2058 | #endif |
2059 | sb->s_flags = s_flags; /* Restore MS_RDONLY status */ | 2059 | sb->s_flags = s_flags; /* Restore MS_RDONLY status */ |
@@ -3924,16 +3924,13 @@ static int ext4_quota_on_mount(struct super_block *sb, int type) | |||
3924 | * Standard function to be called on quota_on | 3924 | * Standard function to be called on quota_on |
3925 | */ | 3925 | */ |
3926 | static int ext4_quota_on(struct super_block *sb, int type, int format_id, | 3926 | static int ext4_quota_on(struct super_block *sb, int type, int format_id, |
3927 | char *name, int remount) | 3927 | char *name) |
3928 | { | 3928 | { |
3929 | int err; | 3929 | int err; |
3930 | struct path path; | 3930 | struct path path; |
3931 | 3931 | ||
3932 | if (!test_opt(sb, QUOTA)) | 3932 | if (!test_opt(sb, QUOTA)) |
3933 | return -EINVAL; | 3933 | return -EINVAL; |
3934 | /* When remounting, no checks are needed and in fact, name is NULL */ | ||
3935 | if (remount) | ||
3936 | return vfs_quota_on(sb, type, format_id, name, remount); | ||
3937 | 3934 | ||
3938 | err = kern_path(name, LOOKUP_FOLLOW, &path); | 3935 | err = kern_path(name, LOOKUP_FOLLOW, &path); |
3939 | if (err) | 3936 | if (err) |
diff --git a/fs/ocfs2/super.c b/fs/ocfs2/super.c index 0773873d590a..5367d6dee395 100644 --- a/fs/ocfs2/super.c +++ b/fs/ocfs2/super.c | |||
@@ -964,7 +964,7 @@ static void ocfs2_disable_quotas(struct ocfs2_super *osb) | |||
964 | 964 | ||
965 | /* Handle quota on quotactl */ | 965 | /* Handle quota on quotactl */ |
966 | static int ocfs2_quota_on(struct super_block *sb, int type, int format_id, | 966 | static int ocfs2_quota_on(struct super_block *sb, int type, int format_id, |
967 | char *path, int remount) | 967 | char *path) |
968 | { | 968 | { |
969 | unsigned int feature[MAXQUOTAS] = { OCFS2_FEATURE_RO_COMPAT_USRQUOTA, | 969 | unsigned int feature[MAXQUOTAS] = { OCFS2_FEATURE_RO_COMPAT_USRQUOTA, |
970 | OCFS2_FEATURE_RO_COMPAT_GRPQUOTA}; | 970 | OCFS2_FEATURE_RO_COMPAT_GRPQUOTA}; |
@@ -972,19 +972,13 @@ static int ocfs2_quota_on(struct super_block *sb, int type, int format_id, | |||
972 | if (!OCFS2_HAS_RO_COMPAT_FEATURE(sb, feature[type])) | 972 | if (!OCFS2_HAS_RO_COMPAT_FEATURE(sb, feature[type])) |
973 | return -EINVAL; | 973 | return -EINVAL; |
974 | 974 | ||
975 | if (remount) | ||
976 | return 0; /* Just ignore it has been handled in | ||
977 | * ocfs2_remount() */ | ||
978 | return vfs_quota_enable(sb_dqopt(sb)->files[type], type, | 975 | return vfs_quota_enable(sb_dqopt(sb)->files[type], type, |
979 | format_id, DQUOT_LIMITS_ENABLED); | 976 | format_id, DQUOT_LIMITS_ENABLED); |
980 | } | 977 | } |
981 | 978 | ||
982 | /* Handle quota off quotactl */ | 979 | /* Handle quota off quotactl */ |
983 | static int ocfs2_quota_off(struct super_block *sb, int type, int remount) | 980 | static int ocfs2_quota_off(struct super_block *sb, int type) |
984 | { | 981 | { |
985 | if (remount) | ||
986 | return 0; /* Ignore now and handle later in | ||
987 | * ocfs2_remount() */ | ||
988 | return dquot_disable(sb, type, DQUOT_LIMITS_ENABLED); | 982 | return dquot_disable(sb, type, DQUOT_LIMITS_ENABLED); |
989 | } | 983 | } |
990 | 984 | ||
diff --git a/fs/quota/dquot.c b/fs/quota/dquot.c index cf972283e474..b84422657f6d 100644 --- a/fs/quota/dquot.c +++ b/fs/quota/dquot.c | |||
@@ -1997,9 +1997,8 @@ put_inodes: | |||
1997 | } | 1997 | } |
1998 | EXPORT_SYMBOL(dquot_disable); | 1998 | EXPORT_SYMBOL(dquot_disable); |
1999 | 1999 | ||
2000 | int vfs_quota_off(struct super_block *sb, int type, int remount) | 2000 | int vfs_quota_off(struct super_block *sb, int type) |
2001 | { | 2001 | { |
2002 | BUG_ON(remount); | ||
2003 | return dquot_disable(sb, type, | 2002 | return dquot_disable(sb, type, |
2004 | DQUOT_USAGE_ENABLED | DQUOT_LIMITS_ENABLED); | 2003 | DQUOT_USAGE_ENABLED | DQUOT_LIMITS_ENABLED); |
2005 | } | 2004 | } |
@@ -2175,14 +2174,11 @@ int vfs_quota_on_path(struct super_block *sb, int type, int format_id, | |||
2175 | } | 2174 | } |
2176 | EXPORT_SYMBOL(vfs_quota_on_path); | 2175 | EXPORT_SYMBOL(vfs_quota_on_path); |
2177 | 2176 | ||
2178 | int vfs_quota_on(struct super_block *sb, int type, int format_id, char *name, | 2177 | int vfs_quota_on(struct super_block *sb, int type, int format_id, char *name) |
2179 | int remount) | ||
2180 | { | 2178 | { |
2181 | struct path path; | 2179 | struct path path; |
2182 | int error; | 2180 | int error; |
2183 | 2181 | ||
2184 | BUG_ON(remount); | ||
2185 | |||
2186 | error = kern_path(name, LOOKUP_FOLLOW, &path); | 2182 | error = kern_path(name, LOOKUP_FOLLOW, &path); |
2187 | if (!error) { | 2183 | if (!error) { |
2188 | error = vfs_quota_on_path(sb, type, format_id, &path); | 2184 | error = vfs_quota_on_path(sb, type, format_id, &path); |
diff --git a/fs/quota/quota.c b/fs/quota/quota.c index ce3dfd066f59..b299961e1edb 100644 --- a/fs/quota/quota.c +++ b/fs/quota/quota.c | |||
@@ -73,7 +73,7 @@ static int quota_quotaon(struct super_block *sb, int type, int cmd, qid_t id, | |||
73 | if (IS_ERR(pathname)) | 73 | if (IS_ERR(pathname)) |
74 | return PTR_ERR(pathname); | 74 | return PTR_ERR(pathname); |
75 | if (sb->s_qcop->quota_on) | 75 | if (sb->s_qcop->quota_on) |
76 | ret = sb->s_qcop->quota_on(sb, type, id, pathname, 0); | 76 | ret = sb->s_qcop->quota_on(sb, type, id, pathname); |
77 | putname(pathname); | 77 | putname(pathname); |
78 | return ret; | 78 | return ret; |
79 | } | 79 | } |
@@ -260,7 +260,7 @@ static int do_quotactl(struct super_block *sb, int type, int cmd, qid_t id, | |||
260 | case Q_QUOTAOFF: | 260 | case Q_QUOTAOFF: |
261 | if (!sb->s_qcop->quota_off) | 261 | if (!sb->s_qcop->quota_off) |
262 | return -ENOSYS; | 262 | return -ENOSYS; |
263 | return sb->s_qcop->quota_off(sb, type, 0); | 263 | return sb->s_qcop->quota_off(sb, type); |
264 | case Q_GETFMT: | 264 | case Q_GETFMT: |
265 | return quota_getfmt(sb, type, addr); | 265 | return quota_getfmt(sb, type, addr); |
266 | case Q_GETINFO: | 266 | case Q_GETINFO: |
diff --git a/fs/reiserfs/super.c b/fs/reiserfs/super.c index 08879af0af0d..fa46abd0d958 100644 --- a/fs/reiserfs/super.c +++ b/fs/reiserfs/super.c | |||
@@ -305,7 +305,7 @@ static int finish_unfinished(struct super_block *s) | |||
305 | /* Turn quotas off */ | 305 | /* Turn quotas off */ |
306 | for (i = 0; i < MAXQUOTAS; i++) { | 306 | for (i = 0; i < MAXQUOTAS; i++) { |
307 | if (sb_dqopt(s)->files[i]) | 307 | if (sb_dqopt(s)->files[i]) |
308 | vfs_quota_off(s, i, 0); | 308 | vfs_quota_off(s, i); |
309 | } | 309 | } |
310 | if (ms_active_set) | 310 | if (ms_active_set) |
311 | /* Restore the flag back */ | 311 | /* Restore the flag back */ |
@@ -622,7 +622,7 @@ static int reiserfs_acquire_dquot(struct dquot *); | |||
622 | static int reiserfs_release_dquot(struct dquot *); | 622 | static int reiserfs_release_dquot(struct dquot *); |
623 | static int reiserfs_mark_dquot_dirty(struct dquot *); | 623 | static int reiserfs_mark_dquot_dirty(struct dquot *); |
624 | static int reiserfs_write_info(struct super_block *, int); | 624 | static int reiserfs_write_info(struct super_block *, int); |
625 | static int reiserfs_quota_on(struct super_block *, int, int, char *, int); | 625 | static int reiserfs_quota_on(struct super_block *, int, int, char *); |
626 | 626 | ||
627 | static const struct dquot_operations reiserfs_quota_operations = { | 627 | static const struct dquot_operations reiserfs_quota_operations = { |
628 | .write_dquot = reiserfs_write_dquot, | 628 | .write_dquot = reiserfs_write_dquot, |
@@ -2038,7 +2038,7 @@ static int reiserfs_quota_on_mount(struct super_block *sb, int type) | |||
2038 | * Standard function to be called on quota_on | 2038 | * Standard function to be called on quota_on |
2039 | */ | 2039 | */ |
2040 | static int reiserfs_quota_on(struct super_block *sb, int type, int format_id, | 2040 | static int reiserfs_quota_on(struct super_block *sb, int type, int format_id, |
2041 | char *name, int remount) | 2041 | char *name) |
2042 | { | 2042 | { |
2043 | int err; | 2043 | int err; |
2044 | struct path path; | 2044 | struct path path; |
@@ -2047,9 +2047,7 @@ static int reiserfs_quota_on(struct super_block *sb, int type, int format_id, | |||
2047 | 2047 | ||
2048 | if (!(REISERFS_SB(sb)->s_mount_opt & (1 << REISERFS_QUOTA))) | 2048 | if (!(REISERFS_SB(sb)->s_mount_opt & (1 << REISERFS_QUOTA))) |
2049 | return -EINVAL; | 2049 | return -EINVAL; |
2050 | /* No more checks needed? Path and format_id are bogus anyway... */ | 2050 | |
2051 | if (remount) | ||
2052 | return vfs_quota_on(sb, type, format_id, name, 1); | ||
2053 | err = kern_path(name, LOOKUP_FOLLOW, &path); | 2051 | err = kern_path(name, LOOKUP_FOLLOW, &path); |
2054 | if (err) | 2052 | if (err) |
2055 | return err; | 2053 | return err; |