aboutsummaryrefslogtreecommitdiffstats
path: root/fs/quota.c
diff options
context:
space:
mode:
authorJan Kara <jack@suse.cz>2008-08-20 11:50:32 -0400
committerMark Fasheh <mfasheh@suse.com>2009-01-05 11:36:56 -0500
commitf55abc0fb9c3189de3da829adf3220322c0da43e (patch)
tree0db4b838b0b90f27401783e8e7e45842ec91f90a /fs/quota.c
parente4bc7b4b7ff783779b6928d55a9308910bf180a3 (diff)
quota: Allow to separately enable quota accounting and enforcing limits
Split DQUOT_USR_ENABLED (and DQUOT_GRP_ENABLED) into DQUOT_USR_USAGE_ENABLED and DQUOT_USR_LIMITS_ENABLED. This way we are able to separately enable / disable whether we should: 1) ignore quotas completely 2) just keep uptodate information about usage 3) actually enforce quota limits This is going to be useful when quota is treated as filesystem metadata - we then want to keep quota information uptodate all the time and just enable / disable limits enforcement. Signed-off-by: Jan Kara <jack@suse.cz> Signed-off-by: Mark Fasheh <mfasheh@suse.com>
Diffstat (limited to 'fs/quota.c')
-rw-r--r--fs/quota.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/fs/quota.c b/fs/quota.c
index b7fe44e01618..8678d9f35ee9 100644
--- a/fs/quota.c
+++ b/fs/quota.c
@@ -73,7 +73,7 @@ static int generic_quotactl_valid(struct super_block *sb, int type, int cmd, qid
73 case Q_SETQUOTA: 73 case Q_SETQUOTA:
74 case Q_GETQUOTA: 74 case Q_GETQUOTA:
75 /* This is just informative test so we are satisfied without a lock */ 75 /* This is just informative test so we are satisfied without a lock */
76 if (!sb_has_quota_enabled(sb, type)) 76 if (!sb_has_quota_active(sb, type))
77 return -ESRCH; 77 return -ESRCH;
78 } 78 }
79 79
@@ -175,7 +175,7 @@ static void quota_sync_sb(struct super_block *sb, int type)
175 for (cnt = 0; cnt < MAXQUOTAS; cnt++) { 175 for (cnt = 0; cnt < MAXQUOTAS; cnt++) {
176 if (type != -1 && cnt != type) 176 if (type != -1 && cnt != type)
177 continue; 177 continue;
178 if (!sb_has_quota_enabled(sb, cnt)) 178 if (!sb_has_quota_active(sb, cnt))
179 continue; 179 continue;
180 mutex_lock_nested(&sb_dqopt(sb)->files[cnt]->i_mutex, I_MUTEX_QUOTA); 180 mutex_lock_nested(&sb_dqopt(sb)->files[cnt]->i_mutex, I_MUTEX_QUOTA);
181 truncate_inode_pages(&sb_dqopt(sb)->files[cnt]->i_data, 0); 181 truncate_inode_pages(&sb_dqopt(sb)->files[cnt]->i_data, 0);
@@ -201,7 +201,7 @@ restart:
201 for (cnt = 0; cnt < MAXQUOTAS; cnt++) { 201 for (cnt = 0; cnt < MAXQUOTAS; cnt++) {
202 if (type != -1 && type != cnt) 202 if (type != -1 && type != cnt)
203 continue; 203 continue;
204 if (!sb_has_quota_enabled(sb, cnt)) 204 if (!sb_has_quota_active(sb, cnt))
205 continue; 205 continue;
206 if (!info_dirty(&sb_dqopt(sb)->info[cnt]) && 206 if (!info_dirty(&sb_dqopt(sb)->info[cnt]) &&
207 list_empty(&sb_dqopt(sb)->info[cnt].dqi_dirty_list)) 207 list_empty(&sb_dqopt(sb)->info[cnt].dqi_dirty_list))
@@ -245,7 +245,7 @@ static int do_quotactl(struct super_block *sb, int type, int cmd, qid_t id, void
245 __u32 fmt; 245 __u32 fmt;
246 246
247 down_read(&sb_dqopt(sb)->dqptr_sem); 247 down_read(&sb_dqopt(sb)->dqptr_sem);
248 if (!sb_has_quota_enabled(sb, type)) { 248 if (!sb_has_quota_active(sb, type)) {
249 up_read(&sb_dqopt(sb)->dqptr_sem); 249 up_read(&sb_dqopt(sb)->dqptr_sem);
250 return -ESRCH; 250 return -ESRCH;
251 } 251 }