diff options
author | Jan Kara <jack@suse.cz> | 2008-04-28 05:14:35 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2008-04-28 11:58:33 -0400 |
commit | 1b445a9c21f593be9d3c4ab912359d2c51c371dd (patch) | |
tree | 3e211200d83d4e47f3b5bb18ca97af7a0db553d1 /fs | |
parent | 6f28e08794749f3431e89302728e612343d9d9e4 (diff) |
quota: reiserfs: make reiserfs handle quotaon on remount
Update reiserfs to handle quotaon on remount RW.
Signed-off-by: Jan Kara <jack@suse.cz>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/reiserfs/super.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/fs/reiserfs/super.c b/fs/reiserfs/super.c index 3e1972d31e44..f8f9a473e670 100644 --- a/fs/reiserfs/super.c +++ b/fs/reiserfs/super.c | |||
@@ -304,7 +304,7 @@ static int finish_unfinished(struct super_block *s) | |||
304 | /* Turn quotas off */ | 304 | /* Turn quotas off */ |
305 | for (i = 0; i < MAXQUOTAS; i++) { | 305 | for (i = 0; i < MAXQUOTAS; i++) { |
306 | if (sb_dqopt(s)->files[i]) | 306 | if (sb_dqopt(s)->files[i]) |
307 | vfs_quota_off(s, i); | 307 | vfs_quota_off(s, i, 0); |
308 | } | 308 | } |
309 | if (ms_active_set) | 309 | if (ms_active_set) |
310 | /* Restore the flag back */ | 310 | /* Restore the flag back */ |
@@ -634,7 +634,7 @@ static int reiserfs_acquire_dquot(struct dquot *); | |||
634 | static int reiserfs_release_dquot(struct dquot *); | 634 | static int reiserfs_release_dquot(struct dquot *); |
635 | static int reiserfs_mark_dquot_dirty(struct dquot *); | 635 | static int reiserfs_mark_dquot_dirty(struct dquot *); |
636 | static int reiserfs_write_info(struct super_block *, int); | 636 | static int reiserfs_write_info(struct super_block *, int); |
637 | static int reiserfs_quota_on(struct super_block *, int, int, char *); | 637 | static int reiserfs_quota_on(struct super_block *, int, int, char *, int); |
638 | 638 | ||
639 | static struct dquot_operations reiserfs_quota_operations = { | 639 | static struct dquot_operations reiserfs_quota_operations = { |
640 | .initialize = reiserfs_dquot_initialize, | 640 | .initialize = reiserfs_dquot_initialize, |
@@ -2015,13 +2015,16 @@ static int reiserfs_quota_on_mount(struct super_block *sb, int type) | |||
2015 | * Standard function to be called on quota_on | 2015 | * Standard function to be called on quota_on |
2016 | */ | 2016 | */ |
2017 | static int reiserfs_quota_on(struct super_block *sb, int type, int format_id, | 2017 | static int reiserfs_quota_on(struct super_block *sb, int type, int format_id, |
2018 | char *path) | 2018 | char *path, int remount) |
2019 | { | 2019 | { |
2020 | int err; | 2020 | int err; |
2021 | struct nameidata nd; | 2021 | struct nameidata nd; |
2022 | 2022 | ||
2023 | if (!(REISERFS_SB(sb)->s_mount_opt & (1 << REISERFS_QUOTA))) | 2023 | if (!(REISERFS_SB(sb)->s_mount_opt & (1 << REISERFS_QUOTA))) |
2024 | return -EINVAL; | 2024 | return -EINVAL; |
2025 | /* No more checks needed? Path and format_id are bogus anyway... */ | ||
2026 | if (remount) | ||
2027 | return vfs_quota_on(sb, type, format_id, path, 1); | ||
2025 | err = path_lookup(path, LOOKUP_FOLLOW, &nd); | 2028 | err = path_lookup(path, LOOKUP_FOLLOW, &nd); |
2026 | if (err) | 2029 | if (err) |
2027 | return err; | 2030 | return err; |
@@ -2041,7 +2044,7 @@ static int reiserfs_quota_on(struct super_block *sb, int type, int format_id, | |||
2041 | if (!REISERFS_SB(sb)->s_qf_names[USRQUOTA] && | 2044 | if (!REISERFS_SB(sb)->s_qf_names[USRQUOTA] && |
2042 | !REISERFS_SB(sb)->s_qf_names[GRPQUOTA]) { | 2045 | !REISERFS_SB(sb)->s_qf_names[GRPQUOTA]) { |
2043 | path_put(&nd.path); | 2046 | path_put(&nd.path); |
2044 | return vfs_quota_on(sb, type, format_id, path); | 2047 | return vfs_quota_on(sb, type, format_id, path, 0); |
2045 | } | 2048 | } |
2046 | /* Quotafile not of fs root? */ | 2049 | /* Quotafile not of fs root? */ |
2047 | if (nd.path.dentry->d_parent->d_inode != sb->s_root->d_inode) | 2050 | if (nd.path.dentry->d_parent->d_inode != sb->s_root->d_inode) |
@@ -2049,7 +2052,7 @@ static int reiserfs_quota_on(struct super_block *sb, int type, int format_id, | |||
2049 | "reiserfs: Quota file not on filesystem root. " | 2052 | "reiserfs: Quota file not on filesystem root. " |
2050 | "Journalled quota will not work."); | 2053 | "Journalled quota will not work."); |
2051 | path_put(&nd.path); | 2054 | path_put(&nd.path); |
2052 | return vfs_quota_on(sb, type, format_id, path); | 2055 | return vfs_quota_on(sb, type, format_id, path, 0); |
2053 | } | 2056 | } |
2054 | 2057 | ||
2055 | /* Read data from quotafile - avoid pagecache and such because we cannot afford | 2058 | /* Read data from quotafile - avoid pagecache and such because we cannot afford |