aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--fs/ext3/super.c9
-rw-r--r--fs/ext4/super.c9
-rw-r--r--fs/ocfs2/super.c10
-rw-r--r--fs/quota/dquot.c8
-rw-r--r--fs/quota/quota.c4
-rw-r--r--fs/reiserfs/super.c10
-rw-r--r--include/linux/quota.h4
-rw-r--r--include/linux/quotaops.h4
8 files changed, 20 insertions, 38 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);
750static int ext3_mark_dquot_dirty(struct dquot *dquot); 750static int ext3_mark_dquot_dirty(struct dquot *dquot);
751static int ext3_write_info(struct super_block *sb, int type); 751static int ext3_write_info(struct super_block *sb, int type);
752static int ext3_quota_on(struct super_block *sb, int type, int format_id, 752static int ext3_quota_on(struct super_block *sb, int type, int format_id,
753 char *path, int remount); 753 char *path);
754static int ext3_quota_on_mount(struct super_block *sb, int type); 754static int ext3_quota_on_mount(struct super_block *sb, int type);
755static ssize_t ext3_quota_read(struct super_block *sb, int type, char *data, 755static 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 */
2872static int ext3_quota_on(struct super_block *sb, int type, int format_id, 2872static 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);
1061static int ext4_mark_dquot_dirty(struct dquot *dquot); 1061static int ext4_mark_dquot_dirty(struct dquot *dquot);
1062static int ext4_write_info(struct super_block *sb, int type); 1062static int ext4_write_info(struct super_block *sb, int type);
1063static int ext4_quota_on(struct super_block *sb, int type, int format_id, 1063static int ext4_quota_on(struct super_block *sb, int type, int format_id,
1064 char *path, int remount); 1064 char *path);
1065static int ext4_quota_on_mount(struct super_block *sb, int type); 1065static int ext4_quota_on_mount(struct super_block *sb, int type);
1066static ssize_t ext4_quota_read(struct super_block *sb, int type, char *data, 1066static 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 */
3926static int ext4_quota_on(struct super_block *sb, int type, int format_id, 3926static 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 */
966static int ocfs2_quota_on(struct super_block *sb, int type, int format_id, 966static 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 */
983static int ocfs2_quota_off(struct super_block *sb, int type, int remount) 980static 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}
1998EXPORT_SYMBOL(dquot_disable); 1998EXPORT_SYMBOL(dquot_disable);
1999 1999
2000int vfs_quota_off(struct super_block *sb, int type, int remount) 2000int 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}
2176EXPORT_SYMBOL(vfs_quota_on_path); 2175EXPORT_SYMBOL(vfs_quota_on_path);
2177 2176
2178int vfs_quota_on(struct super_block *sb, int type, int format_id, char *name, 2177int 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 *);
622static int reiserfs_release_dquot(struct dquot *); 622static int reiserfs_release_dquot(struct dquot *);
623static int reiserfs_mark_dquot_dirty(struct dquot *); 623static int reiserfs_mark_dquot_dirty(struct dquot *);
624static int reiserfs_write_info(struct super_block *, int); 624static int reiserfs_write_info(struct super_block *, int);
625static int reiserfs_quota_on(struct super_block *, int, int, char *, int); 625static int reiserfs_quota_on(struct super_block *, int, int, char *);
626 626
627static const struct dquot_operations reiserfs_quota_operations = { 627static 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 */
2040static int reiserfs_quota_on(struct super_block *sb, int type, int format_id, 2040static 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;
diff --git a/include/linux/quota.h b/include/linux/quota.h
index 7126a15467f1..2789d07c37be 100644
--- a/include/linux/quota.h
+++ b/include/linux/quota.h
@@ -332,8 +332,8 @@ struct dquot_operations {
332 332
333/* Operations handling requests from userspace */ 333/* Operations handling requests from userspace */
334struct quotactl_ops { 334struct quotactl_ops {
335 int (*quota_on)(struct super_block *, int, int, char *, int); 335 int (*quota_on)(struct super_block *, int, int, char *);
336 int (*quota_off)(struct super_block *, int, int); 336 int (*quota_off)(struct super_block *, int);
337 int (*quota_sync)(struct super_block *, int, int); 337 int (*quota_sync)(struct super_block *, int, int);
338 int (*get_info)(struct super_block *, int, struct if_dqinfo *); 338 int (*get_info)(struct super_block *, int, struct if_dqinfo *);
339 int (*set_info)(struct super_block *, int, struct if_dqinfo *); 339 int (*set_info)(struct super_block *, int, struct if_dqinfo *);
diff --git a/include/linux/quotaops.h b/include/linux/quotaops.h
index cfa2abb1b6d1..a6592ddc349f 100644
--- a/include/linux/quotaops.h
+++ b/include/linux/quotaops.h
@@ -67,14 +67,14 @@ int dquot_mark_dquot_dirty(struct dquot *dquot);
67int dquot_file_open(struct inode *inode, struct file *file); 67int dquot_file_open(struct inode *inode, struct file *file);
68 68
69int vfs_quota_on(struct super_block *sb, int type, int format_id, 69int vfs_quota_on(struct super_block *sb, int type, int format_id,
70 char *path, int remount); 70 char *path);
71int vfs_quota_enable(struct inode *inode, int type, int format_id, 71int vfs_quota_enable(struct inode *inode, int type, int format_id,
72 unsigned int flags); 72 unsigned int flags);
73int vfs_quota_on_path(struct super_block *sb, int type, int format_id, 73int vfs_quota_on_path(struct super_block *sb, int type, int format_id,
74 struct path *path); 74 struct path *path);
75int vfs_quota_on_mount(struct super_block *sb, char *qf_name, 75int vfs_quota_on_mount(struct super_block *sb, char *qf_name,
76 int format_id, int type); 76 int format_id, int type);
77int vfs_quota_off(struct super_block *sb, int type, int remount); 77int vfs_quota_off(struct super_block *sb, int type);
78int vfs_quota_sync(struct super_block *sb, int type, int wait); 78int vfs_quota_sync(struct super_block *sb, int type, int wait);
79int vfs_get_dqinfo(struct super_block *sb, int type, struct if_dqinfo *ii); 79int vfs_get_dqinfo(struct super_block *sb, int type, struct if_dqinfo *ii);
80int vfs_set_dqinfo(struct super_block *sb, int type, struct if_dqinfo *ii); 80int vfs_set_dqinfo(struct super_block *sb, int type, struct if_dqinfo *ii);