LASSERTF(qti->qti_pools_num >= QMT_MAX_POOL_NUM,
"Forgot init? %p\n", qti);
- if (qti->qti_pools_cnt > qti->qti_pools_num) {
+ if (qti->qti_pools_cnt >= qti->qti_pools_num) {
OBD_ALLOC(pools, sizeof(qpi) * qti->qti_pools_num * 2);
if (!pools)
return -ENOMEM;
RETURN(ERR_PTR(-ENOENT));
}
- CDEBUG(D_QUOTA, "type %d name %p index %d\n",
- rtype, pool_name, idx);
+ CDEBUG(D_QUOTA, "type %d name %s index %d\n",
+ rtype, pool_name ?: "<none>", idx);
/* Now just find a pool with correct type in a list. Further we need
* to go through the list and find a pool that includes requested OST
* or MDT. Possibly this would return a list of pools that includes
static int lqes_cmp(const void *arg1, const void *arg2)
{
const struct lquota_entry *lqe1, *lqe2;
- lqe1 = arg1;
- lqe2 = arg2;
- return lqe1->lqe_qunit > lqe2->lqe_qunit;
+
+ lqe1 = *(const struct lquota_entry **)arg1;
+ lqe2 = *(const struct lquota_entry **)arg2;
+ if (lqe1->lqe_qunit > lqe2->lqe_qunit)
+ return 1;
+ if (lqe1->lqe_qunit < lqe2->lqe_qunit)
+ return -1;
+ return 0;
}
void qmt_lqes_sort(const struct lu_env *env)
switch (qpi->qpi_rtype) {
case LQUOTA_RES_DT:
- return tgt_pool_init(&qpi->qpi_sarr.osts, 0);
+ return lu_tgt_pool_init(&qpi->qpi_sarr.osts, 0);
case LQUOTA_RES_MD:
default:
return 0;
{
switch (qpi->qpi_rtype) {
case LQUOTA_RES_DT:
- return tgt_pool_add(&qpi->qpi_sarr.osts, idx, min);
+ return lu_tgt_pool_add(&qpi->qpi_sarr.osts, idx, min);
case LQUOTA_RES_MD:
default:
return 0;
{
switch (qpi->qpi_rtype) {
case LQUOTA_RES_DT:
- return tgt_pool_remove(&qpi->qpi_sarr.osts, idx);
+ return lu_tgt_pool_remove(&qpi->qpi_sarr.osts, idx);
case LQUOTA_RES_MD:
default:
return 0;
case LQUOTA_RES_DT:
if (!qpi->qpi_sarr.osts.op_array)
return 0;
- return tgt_pool_free(&qpi->qpi_sarr.osts);
+ return lu_tgt_pool_free(&qpi->qpi_sarr.osts);
case LQUOTA_RES_MD:
default:
return 0;
switch (qpi->qpi_rtype) {
case LQUOTA_RES_DT:
- return tgt_check_index(idx, &qpi->qpi_sarr.osts);
+ return lu_tgt_check_index(idx, &qpi->qpi_sarr.osts);
case LQUOTA_RES_MD:
default:
return 0;
}
}
-inline struct rw_semaphore *qmt_sarr_rwsem(struct qmt_pool_info *qpi)
+struct rw_semaphore *qmt_sarr_rwsem(struct qmt_pool_info *qpi)
{
switch (qpi->qpi_rtype) {
case LQUOTA_RES_DT:
}
}
-inline int qmt_sarr_get_idx(struct qmt_pool_info *qpi, int arr_idx)
+int qmt_sarr_get_idx(struct qmt_pool_info *qpi, int arr_idx)
{
if (qmt_pool_global(qpi))
}
/* Number of slaves in a pool */
-inline unsigned int qmt_sarr_count(struct qmt_pool_info *qpi)
+unsigned int qmt_sarr_count(struct qmt_pool_info *qpi)
{
switch (qpi->qpi_rtype) {
case LQUOTA_RES_DT: