int lu_tgt_pool_init(struct lu_tgt_pool *op, unsigned int count);
int lu_tgt_pool_add(struct lu_tgt_pool *op, __u32 idx, unsigned int min_count);
int lu_tgt_pool_remove(struct lu_tgt_pool *op, __u32 idx);
-int lu_tgt_pool_free(struct lu_tgt_pool *op);
+void lu_tgt_pool_free(struct lu_tgt_pool *op);
int lu_tgt_check_index(int idx, struct lu_tgt_pool *osts);
int lu_tgt_pool_extend(struct lu_tgt_pool *op, unsigned int min_count);
int lu_tgt_check_index(int idx, struct lu_tgt_pool *osts)
{
- int rc, i;
+ int i, rc = -ENOENT;
ENTRY;
down_read(&osts->op_rw_sem);
if (osts->op_array[i] == idx)
GOTO(out, rc = 0);
}
- rc = -ENOENT;
EXIT;
out:
up_read(&osts->op_rw_sem);
* deleted from memory.
*
* \param[in] op pool to be freed.
- *
- * \retval 0 on success or if pool was already freed
*/
-int lu_tgt_pool_free(struct lu_tgt_pool *op)
+void lu_tgt_pool_free(struct lu_tgt_pool *op)
{
ENTRY;
if (op->op_size == 0)
- RETURN(0);
+ RETURN_EXIT;
down_write(&op->op_rw_sem);
op->op_size = 0;
up_write(&op->op_rw_sem);
- RETURN(0);
+ EXIT;
}
EXPORT_SYMBOL(lu_tgt_pool_free);
int qmt_glb_write_lqes(const struct lu_env *env, struct thandle *th,
__u32 flags, __u64 *ver)
{
- int i, rc;
- rc = 0;
+ int i, rc = 0;
for (i = 0; i < qti_lqes_cnt(env); i++) {
rc = qmt_glb_write(env, th, qti_lqes(env)[i], flags, ver);
* we are thus dealing with an ID lock. */
struct lquota_entry *lqe = res->lr_lvb_data;
struct qmt_device *qmt;
- struct obd_uuid *uuid;
+ struct obd_uuid *uuid;
int idx;
uuid = &(lock)->l_export->exp_client_uuid;
lqe_putref(lqe);
} else {
/* global quota lock */
- struct dt_object *obj = res->lr_lvb_data;
+ struct dt_object *obj = res->lr_lvb_data;
/* return current version of global index */
qlvb->lvb_glb_ver = dt_version_get(env, obj);
static inline int qmt_sarr_pool_add(struct qmt_pool_info *qpi,
int idx, int min);
static inline int qmt_sarr_pool_rem(struct qmt_pool_info *qpi, int idx);
-static inline int qmt_sarr_pool_free(struct qmt_pool_info *qpi);
+static inline void qmt_sarr_pool_free(struct qmt_pool_info *qpi);
static inline int qmt_sarr_check_idx(struct qmt_pool_info *qpi, int idx);
static inline void qmt_stop_pool_recalc(struct qmt_pool_info *qpi);
qti_lqes_fini(env);
GOTO(out, rc = PTR_ERR(lqe));
}
- /* Only release could be done for not enforced lqe
- * (see qmt_dqacq0). However slave could request to
- * release more than not global lqe had granted before
- * lqe_enforced was cleared. It is legal case,
- * because even if current lqe is not enforced,
- * lqes from other pools are still active and avilable
- * for acquiring. Furthermore, skip not enforced lqe
- * to don't make extra allocations. */
- /*if (!lqe_is_glbl(lqe) && !lqe->lqe_enforced) {
- lqe_putref(lqe);
- continue;
- }*/
qti_lqes_add(env, lqe);
}
LASSERT(qti_lqes_glbl(env)->lqe_is_global);
}
}
-static inline int qmt_sarr_pool_free(struct qmt_pool_info *qpi)
+static inline void qmt_sarr_pool_free(struct qmt_pool_info *qpi)
{
if (qmt_pool_global(qpi))
- return 0;
+ return;
switch (qpi->qpi_rtype) {
case LQUOTA_RES_DT:
- if (!qpi->qpi_sarr.osts.op_array)
- return 0;
- return lu_tgt_pool_free(&qpi->qpi_sarr.osts);
+ if (qpi->qpi_sarr.osts.op_array)
+ lu_tgt_pool_free(&qpi->qpi_sarr.osts);
+ return;
case LQUOTA_RES_MD:
default:
- return 0;
+ return;
}
}
/*
* Update a slave quota entry. This is done by reading enforcement status from
- * the copy of the global index and then how much is the slave currenly owns
+ * the copy of the global index and the amount the slave currenly owns
* for this user from the slave index copy.
*
* \param env - the environment passed by the caller
MAX_DQ_TIME=604800
MAX_IQ_TIME=604800
QTYPE="ugp"
-# QP exists since this version. Should be finally set before landing.
VERSION_WITH_QP="2.13.53"
mds_supports_qp() {
[ $MDS1_VERSION -lt $(version_code $VERSION_WITH_QP) ] &&
cancel_lru_locks osc
sync; sync_all_data || true
# sync means client wrote all it's cache, but id doesn't
- # garantee that slave got new edquot trough glimpse.
+ # guarantee that slave received new edquot through glimpse.
# so wait a little to be sure slave got it.
sleep 5
$RUNAS $DD of=$testfile count=1 seek=$limit &&
error "set user quota failed"
$LFS setquota -u $TSTUSR -b ${limit}M -B 0 --pool $qpool $DIR ||
error "set user quota failed"
- # qpool has minimum soft limit, but it's grace is grater than
- # grace period of qpool2. Thus write shouldn't fail when
+ # qpool has minimum soft limit, but its grace is greater than
+ # the grace period of qpool2. Thus write shouldn't fail when
# hit qpool soft limit - only when reaches up qpool2 limit
# after grace2 seconds.
$LFS setquota -u $TSTUSR -b ${limit2}M -B 0 --pool $qpool2 $DIR ||