diff options
author | Jeremy Cline <jcline@redhat.com> | 2018-07-30 21:37:30 -0400 |
---|---|---|
committer | Jan Kara <jack@suse.cz> | 2018-08-22 12:17:29 -0400 |
commit | 64d9d13828c6c8e188bba63794eee923df3d69a9 (patch) | |
tree | cb5b0cde19e77207113d253a6737c7951706b1df | |
parent | 09a4e0be5826aa66c4ce9954841f110ffe63ef4f (diff) |
fs/quota: Replace XQM_MAXQUOTAS usage with MAXQUOTAS
XQM_MAXQUOTAS and MAXQUOTAS are, it appears, equivalent. Replace all
usage of XQM_MAXQUOTAS and remove it along with the unused XQM_*QUOTA
definitions.
Signed-off-by: Jeremy Cline <jcline@redhat.com>
Signed-off-by: Jan Kara <jack@suse.cz>
-rw-r--r-- | fs/quota/quota.c | 12 | ||||
-rw-r--r-- | include/linux/quota.h | 8 |
2 files changed, 6 insertions, 14 deletions
diff --git a/fs/quota/quota.c b/fs/quota/quota.c index 860bfbe7a07a..d403392d8a0f 100644 --- a/fs/quota/quota.c +++ b/fs/quota/quota.c | |||
@@ -120,8 +120,6 @@ static int quota_getinfo(struct super_block *sb, int type, void __user *addr) | |||
120 | struct if_dqinfo uinfo; | 120 | struct if_dqinfo uinfo; |
121 | int ret; | 121 | int ret; |
122 | 122 | ||
123 | /* This checks whether qc_state has enough entries... */ | ||
124 | BUILD_BUG_ON(MAXQUOTAS > XQM_MAXQUOTAS); | ||
125 | if (!sb->s_qcop->get_state) | 123 | if (!sb->s_qcop->get_state) |
126 | return -ENOSYS; | 124 | return -ENOSYS; |
127 | ret = sb->s_qcop->get_state(sb, &state); | 125 | ret = sb->s_qcop->get_state(sb, &state); |
@@ -354,10 +352,10 @@ static int quota_getstate(struct super_block *sb, struct fs_quota_stat *fqs) | |||
354 | * GETXSTATE quotactl has space for just one set of time limits so | 352 | * GETXSTATE quotactl has space for just one set of time limits so |
355 | * report them for the first enabled quota type | 353 | * report them for the first enabled quota type |
356 | */ | 354 | */ |
357 | for (type = 0; type < XQM_MAXQUOTAS; type++) | 355 | for (type = 0; type < MAXQUOTAS; type++) |
358 | if (state.s_state[type].flags & QCI_ACCT_ENABLED) | 356 | if (state.s_state[type].flags & QCI_ACCT_ENABLED) |
359 | break; | 357 | break; |
360 | BUG_ON(type == XQM_MAXQUOTAS); | 358 | BUG_ON(type == MAXQUOTAS); |
361 | fqs->qs_btimelimit = state.s_state[type].spc_timelimit; | 359 | fqs->qs_btimelimit = state.s_state[type].spc_timelimit; |
362 | fqs->qs_itimelimit = state.s_state[type].ino_timelimit; | 360 | fqs->qs_itimelimit = state.s_state[type].ino_timelimit; |
363 | fqs->qs_rtbtimelimit = state.s_state[type].rt_spc_timelimit; | 361 | fqs->qs_rtbtimelimit = state.s_state[type].rt_spc_timelimit; |
@@ -427,10 +425,10 @@ static int quota_getstatev(struct super_block *sb, struct fs_quota_statv *fqs) | |||
427 | * GETXSTATV quotactl has space for just one set of time limits so | 425 | * GETXSTATV quotactl has space for just one set of time limits so |
428 | * report them for the first enabled quota type | 426 | * report them for the first enabled quota type |
429 | */ | 427 | */ |
430 | for (type = 0; type < XQM_MAXQUOTAS; type++) | 428 | for (type = 0; type < MAXQUOTAS; type++) |
431 | if (state.s_state[type].flags & QCI_ACCT_ENABLED) | 429 | if (state.s_state[type].flags & QCI_ACCT_ENABLED) |
432 | break; | 430 | break; |
433 | BUG_ON(type == XQM_MAXQUOTAS); | 431 | BUG_ON(type == MAXQUOTAS); |
434 | fqs->qs_btimelimit = state.s_state[type].spc_timelimit; | 432 | fqs->qs_btimelimit = state.s_state[type].spc_timelimit; |
435 | fqs->qs_itimelimit = state.s_state[type].ino_timelimit; | 433 | fqs->qs_itimelimit = state.s_state[type].ino_timelimit; |
436 | fqs->qs_rtbtimelimit = state.s_state[type].rt_spc_timelimit; | 434 | fqs->qs_rtbtimelimit = state.s_state[type].rt_spc_timelimit; |
@@ -701,7 +699,7 @@ static int do_quotactl(struct super_block *sb, int type, int cmd, qid_t id, | |||
701 | { | 699 | { |
702 | int ret; | 700 | int ret; |
703 | 701 | ||
704 | if (type >= (XQM_COMMAND(cmd) ? XQM_MAXQUOTAS : MAXQUOTAS)) | 702 | if (type >= MAXQUOTAS) |
705 | return -EINVAL; | 703 | return -EINVAL; |
706 | /* | 704 | /* |
707 | * Quota not supported on this fs? Check this before s_quota_types | 705 | * Quota not supported on this fs? Check this before s_quota_types |
diff --git a/include/linux/quota.h b/include/linux/quota.h index ca9772c8e48b..f32dd270b8e3 100644 --- a/include/linux/quota.h +++ b/include/linux/quota.h | |||
@@ -408,13 +408,7 @@ struct qc_type_state { | |||
408 | 408 | ||
409 | struct qc_state { | 409 | struct qc_state { |
410 | unsigned int s_incoredqs; /* Number of dquots in core */ | 410 | unsigned int s_incoredqs; /* Number of dquots in core */ |
411 | /* | 411 | struct qc_type_state s_state[MAXQUOTAS]; /* Per quota type information */ |
412 | * Per quota type information. The array should really have | ||
413 | * max(MAXQUOTAS, XQM_MAXQUOTAS) entries. BUILD_BUG_ON in | ||
414 | * quota_getinfo() makes sure XQM_MAXQUOTAS is large enough. Once VFS | ||
415 | * supports project quotas, this can be changed to MAXQUOTAS | ||
416 | */ | ||
417 | struct qc_type_state s_state[XQM_MAXQUOTAS]; | ||
418 | }; | 412 | }; |
419 | 413 | ||
420 | /* Structure for communicating via ->set_info */ | 414 | /* Structure for communicating via ->set_info */ |