Commit 64d9d138 authored by Jeremy Cline's avatar Jeremy Cline Committed by Jan Kara

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: default avatarJeremy Cline <jcline@redhat.com>
Signed-off-by: default avatarJan Kara <jack@suse.cz>
parent 09a4e0be
...@@ -120,8 +120,6 @@ static int quota_getinfo(struct super_block *sb, int type, void __user *addr) ...@@ -120,8 +120,6 @@ static int quota_getinfo(struct super_block *sb, int type, void __user *addr)
struct if_dqinfo uinfo; struct if_dqinfo uinfo;
int ret; int ret;
/* This checks whether qc_state has enough entries... */
BUILD_BUG_ON(MAXQUOTAS > XQM_MAXQUOTAS);
if (!sb->s_qcop->get_state) if (!sb->s_qcop->get_state)
return -ENOSYS; return -ENOSYS;
ret = sb->s_qcop->get_state(sb, &state); 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,10 +352,10 @@ static int quota_getstate(struct super_block *sb, struct fs_quota_stat *fqs)
* GETXSTATE quotactl has space for just one set of time limits so * GETXSTATE quotactl has space for just one set of time limits so
* report them for the first enabled quota type * report them for the first enabled quota type
*/ */
for (type = 0; type < XQM_MAXQUOTAS; type++) for (type = 0; type < MAXQUOTAS; type++)
if (state.s_state[type].flags & QCI_ACCT_ENABLED) if (state.s_state[type].flags & QCI_ACCT_ENABLED)
break; break;
BUG_ON(type == XQM_MAXQUOTAS); BUG_ON(type == MAXQUOTAS);
fqs->qs_btimelimit = state.s_state[type].spc_timelimit; fqs->qs_btimelimit = state.s_state[type].spc_timelimit;
fqs->qs_itimelimit = state.s_state[type].ino_timelimit; fqs->qs_itimelimit = state.s_state[type].ino_timelimit;
fqs->qs_rtbtimelimit = state.s_state[type].rt_spc_timelimit; 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,10 +425,10 @@ static int quota_getstatev(struct super_block *sb, struct fs_quota_statv *fqs)
* GETXSTATV quotactl has space for just one set of time limits so * GETXSTATV quotactl has space for just one set of time limits so
* report them for the first enabled quota type * report them for the first enabled quota type
*/ */
for (type = 0; type < XQM_MAXQUOTAS; type++) for (type = 0; type < MAXQUOTAS; type++)
if (state.s_state[type].flags & QCI_ACCT_ENABLED) if (state.s_state[type].flags & QCI_ACCT_ENABLED)
break; break;
BUG_ON(type == XQM_MAXQUOTAS); BUG_ON(type == MAXQUOTAS);
fqs->qs_btimelimit = state.s_state[type].spc_timelimit; fqs->qs_btimelimit = state.s_state[type].spc_timelimit;
fqs->qs_itimelimit = state.s_state[type].ino_timelimit; fqs->qs_itimelimit = state.s_state[type].ino_timelimit;
fqs->qs_rtbtimelimit = state.s_state[type].rt_spc_timelimit; 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,7 +699,7 @@ static int do_quotactl(struct super_block *sb, int type, int cmd, qid_t id,
{ {
int ret; int ret;
if (type >= (XQM_COMMAND(cmd) ? XQM_MAXQUOTAS : MAXQUOTAS)) if (type >= MAXQUOTAS)
return -EINVAL; return -EINVAL;
/* /*
* Quota not supported on this fs? Check this before s_quota_types * Quota not supported on this fs? Check this before s_quota_types
......
...@@ -408,13 +408,7 @@ struct qc_type_state { ...@@ -408,13 +408,7 @@ struct qc_type_state {
struct qc_state { struct qc_state {
unsigned int s_incoredqs; /* Number of dquots in core */ unsigned int s_incoredqs; /* Number of dquots in core */
/* struct qc_type_state s_state[MAXQUOTAS]; /* Per quota type information */
* Per quota type information. The array should really have
* max(MAXQUOTAS, XQM_MAXQUOTAS) entries. BUILD_BUG_ON in
* quota_getinfo() makes sure XQM_MAXQUOTAS is large enough. Once VFS
* supports project quotas, this can be changed to MAXQUOTAS
*/
struct qc_type_state s_state[XQM_MAXQUOTAS];
}; };
/* Structure for communicating via ->set_info */ /* Structure for communicating via ->set_info */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment