diff options
-rw-r--r-- | fs/ocfs2/quota_local.c | 4 | ||||
-rw-r--r-- | fs/quota/dquot.c | 18 | ||||
-rw-r--r-- | fs/quota/quota_v1.c | 4 | ||||
-rw-r--r-- | fs/quota/quota_v2.c | 10 | ||||
-rw-r--r-- | include/linux/quota.h | 4 |
5 files changed, 15 insertions, 25 deletions
diff --git a/fs/ocfs2/quota_local.c b/fs/ocfs2/quota_local.c index 55f832f553cb..89c0b2620814 100644 --- a/fs/ocfs2/quota_local.c +++ b/fs/ocfs2/quota_local.c | |||
@@ -701,8 +701,8 @@ static int ocfs2_local_read_info(struct super_block *sb, int type) | |||
701 | /* We don't need the lock and we have to acquire quota file locks | 701 | /* We don't need the lock and we have to acquire quota file locks |
702 | * which will later depend on this lock */ | 702 | * which will later depend on this lock */ |
703 | mutex_unlock(&sb_dqopt(sb)->dqio_mutex); | 703 | mutex_unlock(&sb_dqopt(sb)->dqio_mutex); |
704 | info->dqi_maxblimit = 0x7fffffffffffffffLL; | 704 | info->dqi_max_spc_limit = 0x7fffffffffffffffLL; |
705 | info->dqi_maxilimit = 0x7fffffffffffffffLL; | 705 | info->dqi_max_ino_limit = 0x7fffffffffffffffLL; |
706 | oinfo = kmalloc(sizeof(struct ocfs2_mem_dqinfo), GFP_NOFS); | 706 | oinfo = kmalloc(sizeof(struct ocfs2_mem_dqinfo), GFP_NOFS); |
707 | if (!oinfo) { | 707 | if (!oinfo) { |
708 | mlog(ML_ERROR, "failed to allocate memory for ocfs2 quota" | 708 | mlog(ML_ERROR, "failed to allocate memory for ocfs2 quota" |
diff --git a/fs/quota/dquot.c b/fs/quota/dquot.c index b47d0c17ea6f..0ccd4ba3a246 100644 --- a/fs/quota/dquot.c +++ b/fs/quota/dquot.c | |||
@@ -2465,16 +2465,6 @@ out_err: | |||
2465 | return ret; | 2465 | return ret; |
2466 | } | 2466 | } |
2467 | 2467 | ||
2468 | static inline qsize_t qbtos(qsize_t blocks) | ||
2469 | { | ||
2470 | return blocks << QIF_DQBLKSIZE_BITS; | ||
2471 | } | ||
2472 | |||
2473 | static inline qsize_t stoqb(qsize_t space) | ||
2474 | { | ||
2475 | return (space + QIF_DQBLKSIZE - 1) >> QIF_DQBLKSIZE_BITS; | ||
2476 | } | ||
2477 | |||
2478 | /* Generic routine for getting common part of quota structure */ | 2468 | /* Generic routine for getting common part of quota structure */ |
2479 | static void do_get_dqblk(struct dquot *dquot, struct qc_dqblk *di) | 2469 | static void do_get_dqblk(struct dquot *dquot, struct qc_dqblk *di) |
2480 | { | 2470 | { |
@@ -2524,13 +2514,13 @@ static int do_set_dqblk(struct dquot *dquot, struct qc_dqblk *di) | |||
2524 | return -EINVAL; | 2514 | return -EINVAL; |
2525 | 2515 | ||
2526 | if (((di->d_fieldmask & QC_SPC_SOFT) && | 2516 | if (((di->d_fieldmask & QC_SPC_SOFT) && |
2527 | stoqb(di->d_spc_softlimit) > dqi->dqi_maxblimit) || | 2517 | di->d_spc_softlimit > dqi->dqi_max_spc_limit) || |
2528 | ((di->d_fieldmask & QC_SPC_HARD) && | 2518 | ((di->d_fieldmask & QC_SPC_HARD) && |
2529 | stoqb(di->d_spc_hardlimit) > dqi->dqi_maxblimit) || | 2519 | di->d_spc_hardlimit > dqi->dqi_max_spc_limit) || |
2530 | ((di->d_fieldmask & QC_INO_SOFT) && | 2520 | ((di->d_fieldmask & QC_INO_SOFT) && |
2531 | (di->d_ino_softlimit > dqi->dqi_maxilimit)) || | 2521 | (di->d_ino_softlimit > dqi->dqi_max_ino_limit)) || |
2532 | ((di->d_fieldmask & QC_INO_HARD) && | 2522 | ((di->d_fieldmask & QC_INO_HARD) && |
2533 | (di->d_ino_hardlimit > dqi->dqi_maxilimit))) | 2523 | (di->d_ino_hardlimit > dqi->dqi_max_ino_limit))) |
2534 | return -ERANGE; | 2524 | return -ERANGE; |
2535 | 2525 | ||
2536 | spin_lock(&dq_data_lock); | 2526 | spin_lock(&dq_data_lock); |
diff --git a/fs/quota/quota_v1.c b/fs/quota/quota_v1.c index 469c6848b322..8fe79beced5c 100644 --- a/fs/quota/quota_v1.c +++ b/fs/quota/quota_v1.c | |||
@@ -169,8 +169,8 @@ static int v1_read_file_info(struct super_block *sb, int type) | |||
169 | } | 169 | } |
170 | ret = 0; | 170 | ret = 0; |
171 | /* limits are stored as unsigned 32-bit data */ | 171 | /* limits are stored as unsigned 32-bit data */ |
172 | dqopt->info[type].dqi_maxblimit = 0xffffffff; | 172 | dqopt->info[type].dqi_max_spc_limit = 0xffffffffULL << QUOTABLOCK_BITS; |
173 | dqopt->info[type].dqi_maxilimit = 0xffffffff; | 173 | dqopt->info[type].dqi_max_ino_limit = 0xffffffff; |
174 | dqopt->info[type].dqi_igrace = | 174 | dqopt->info[type].dqi_igrace = |
175 | dqblk.dqb_itime ? dqblk.dqb_itime : MAX_IQ_TIME; | 175 | dqblk.dqb_itime ? dqblk.dqb_itime : MAX_IQ_TIME; |
176 | dqopt->info[type].dqi_bgrace = | 176 | dqopt->info[type].dqi_bgrace = |
diff --git a/fs/quota/quota_v2.c b/fs/quota/quota_v2.c index 54cac436ac72..9cb10d7197f7 100644 --- a/fs/quota/quota_v2.c +++ b/fs/quota/quota_v2.c | |||
@@ -117,12 +117,12 @@ static int v2_read_file_info(struct super_block *sb, int type) | |||
117 | qinfo = info->dqi_priv; | 117 | qinfo = info->dqi_priv; |
118 | if (version == 0) { | 118 | if (version == 0) { |
119 | /* limits are stored as unsigned 32-bit data */ | 119 | /* limits are stored as unsigned 32-bit data */ |
120 | info->dqi_maxblimit = 0xffffffff; | 120 | info->dqi_max_spc_limit = 0xffffffffULL << QUOTABLOCK_BITS; |
121 | info->dqi_maxilimit = 0xffffffff; | 121 | info->dqi_max_ino_limit = 0xffffffff; |
122 | } else { | 122 | } else { |
123 | /* used space is stored as unsigned 64-bit value */ | 123 | /* used space is stored as unsigned 64-bit value in bytes */ |
124 | info->dqi_maxblimit = 0xffffffffffffffffULL; /* 2^64-1 */ | 124 | info->dqi_max_spc_limit = 0xffffffffffffffffULL; /* 2^64-1 */ |
125 | info->dqi_maxilimit = 0xffffffffffffffffULL; | 125 | info->dqi_max_ino_limit = 0xffffffffffffffffULL; |
126 | } | 126 | } |
127 | info->dqi_bgrace = le32_to_cpu(dinfo.dqi_bgrace); | 127 | info->dqi_bgrace = le32_to_cpu(dinfo.dqi_bgrace); |
128 | info->dqi_igrace = le32_to_cpu(dinfo.dqi_igrace); | 128 | info->dqi_igrace = le32_to_cpu(dinfo.dqi_igrace); |
diff --git a/include/linux/quota.h b/include/linux/quota.h index 0938159d65c8..d534e8ed308a 100644 --- a/include/linux/quota.h +++ b/include/linux/quota.h | |||
@@ -216,8 +216,8 @@ struct mem_dqinfo { | |||
216 | unsigned long dqi_flags; | 216 | unsigned long dqi_flags; |
217 | unsigned int dqi_bgrace; | 217 | unsigned int dqi_bgrace; |
218 | unsigned int dqi_igrace; | 218 | unsigned int dqi_igrace; |
219 | qsize_t dqi_maxblimit; | 219 | qsize_t dqi_max_spc_limit; |
220 | qsize_t dqi_maxilimit; | 220 | qsize_t dqi_max_ino_limit; |
221 | void *dqi_priv; | 221 | void *dqi_priv; |
222 | }; | 222 | }; |
223 | 223 | ||