diff options
-rw-r--r-- | fs/ext4/super.c | 42 |
1 files changed, 1 insertions, 41 deletions
diff --git a/fs/ext4/super.c b/fs/ext4/super.c index 74c5f53595fb..ac64edbe501d 100644 --- a/fs/ext4/super.c +++ b/fs/ext4/super.c | |||
@@ -1046,10 +1046,7 @@ static int ext4_mark_dquot_dirty(struct dquot *dquot); | |||
1046 | static int ext4_write_info(struct super_block *sb, int type); | 1046 | static int ext4_write_info(struct super_block *sb, int type); |
1047 | static int ext4_quota_on(struct super_block *sb, int type, int format_id, | 1047 | static int ext4_quota_on(struct super_block *sb, int type, int format_id, |
1048 | struct path *path); | 1048 | struct path *path); |
1049 | static int ext4_quota_on_sysfile(struct super_block *sb, int type, | ||
1050 | int format_id); | ||
1051 | static int ext4_quota_off(struct super_block *sb, int type); | 1049 | static int ext4_quota_off(struct super_block *sb, int type); |
1052 | static int ext4_quota_off_sysfile(struct super_block *sb, int type); | ||
1053 | static int ext4_quota_on_mount(struct super_block *sb, int type); | 1050 | static int ext4_quota_on_mount(struct super_block *sb, int type); |
1054 | static ssize_t ext4_quota_read(struct super_block *sb, int type, char *data, | 1051 | static ssize_t ext4_quota_read(struct super_block *sb, int type, char *data, |
1055 | size_t len, loff_t off); | 1052 | size_t len, loff_t off); |
@@ -1084,16 +1081,6 @@ static const struct quotactl_ops ext4_qctl_operations = { | |||
1084 | .get_dqblk = dquot_get_dqblk, | 1081 | .get_dqblk = dquot_get_dqblk, |
1085 | .set_dqblk = dquot_set_dqblk | 1082 | .set_dqblk = dquot_set_dqblk |
1086 | }; | 1083 | }; |
1087 | |||
1088 | static const struct quotactl_ops ext4_qctl_sysfile_operations = { | ||
1089 | .quota_on_meta = ext4_quota_on_sysfile, | ||
1090 | .quota_off = ext4_quota_off_sysfile, | ||
1091 | .quota_sync = dquot_quota_sync, | ||
1092 | .get_info = dquot_get_dqinfo, | ||
1093 | .set_info = dquot_set_dqinfo, | ||
1094 | .get_dqblk = dquot_get_dqblk, | ||
1095 | .set_dqblk = dquot_set_dqblk | ||
1096 | }; | ||
1097 | #endif | 1084 | #endif |
1098 | 1085 | ||
1099 | static const struct super_operations ext4_sops = { | 1086 | static const struct super_operations ext4_sops = { |
@@ -3935,7 +3922,7 @@ static int ext4_fill_super(struct super_block *sb, void *data, int silent) | |||
3935 | #ifdef CONFIG_QUOTA | 3922 | #ifdef CONFIG_QUOTA |
3936 | sb->dq_op = &ext4_quota_operations; | 3923 | sb->dq_op = &ext4_quota_operations; |
3937 | if (EXT4_HAS_RO_COMPAT_FEATURE(sb, EXT4_FEATURE_RO_COMPAT_QUOTA)) | 3924 | if (EXT4_HAS_RO_COMPAT_FEATURE(sb, EXT4_FEATURE_RO_COMPAT_QUOTA)) |
3938 | sb->s_qcop = &ext4_qctl_sysfile_operations; | 3925 | sb->s_qcop = &dquot_quotactl_sysfile_ops; |
3939 | else | 3926 | else |
3940 | sb->s_qcop = &ext4_qctl_operations; | 3927 | sb->s_qcop = &ext4_qctl_operations; |
3941 | sb->s_quota_types = QTYPE_MASK_USR | QTYPE_MASK_GRP; | 3928 | sb->s_quota_types = QTYPE_MASK_USR | QTYPE_MASK_GRP; |
@@ -5288,21 +5275,6 @@ static int ext4_enable_quotas(struct super_block *sb) | |||
5288 | return 0; | 5275 | return 0; |
5289 | } | 5276 | } |
5290 | 5277 | ||
5291 | /* | ||
5292 | * quota_on function that is used when QUOTA feature is set. | ||
5293 | */ | ||
5294 | static int ext4_quota_on_sysfile(struct super_block *sb, int type, | ||
5295 | int format_id) | ||
5296 | { | ||
5297 | if (!EXT4_HAS_RO_COMPAT_FEATURE(sb, EXT4_FEATURE_RO_COMPAT_QUOTA)) | ||
5298 | return -EINVAL; | ||
5299 | |||
5300 | /* | ||
5301 | * USAGE was enabled at mount time. Only need to enable LIMITS now. | ||
5302 | */ | ||
5303 | return ext4_quota_enable(sb, type, format_id, DQUOT_LIMITS_ENABLED); | ||
5304 | } | ||
5305 | |||
5306 | static int ext4_quota_off(struct super_block *sb, int type) | 5278 | static int ext4_quota_off(struct super_block *sb, int type) |
5307 | { | 5279 | { |
5308 | struct inode *inode = sb_dqopt(sb)->files[type]; | 5280 | struct inode *inode = sb_dqopt(sb)->files[type]; |
@@ -5329,18 +5301,6 @@ out: | |||
5329 | return dquot_quota_off(sb, type); | 5301 | return dquot_quota_off(sb, type); |
5330 | } | 5302 | } |
5331 | 5303 | ||
5332 | /* | ||
5333 | * quota_off function that is used when QUOTA feature is set. | ||
5334 | */ | ||
5335 | static int ext4_quota_off_sysfile(struct super_block *sb, int type) | ||
5336 | { | ||
5337 | if (!EXT4_HAS_RO_COMPAT_FEATURE(sb, EXT4_FEATURE_RO_COMPAT_QUOTA)) | ||
5338 | return -EINVAL; | ||
5339 | |||
5340 | /* Disable only the limits. */ | ||
5341 | return dquot_disable(sb, type, DQUOT_LIMITS_ENABLED); | ||
5342 | } | ||
5343 | |||
5344 | /* Read data from quotafile - avoid pagecache and such because we cannot afford | 5304 | /* Read data from quotafile - avoid pagecache and such because we cannot afford |
5345 | * acquiring the locks... As quota files are never truncated and quota code | 5305 | * acquiring the locks... As quota files are never truncated and quota code |
5346 | * itself serializes the operations (and no one else should touch the files) | 5306 | * itself serializes the operations (and no one else should touch the files) |