- i = qos_calc_rr(lov);
- if (i)
- RETURN(i);
-
- if (--lov->lov_start_count <= 0) {
- lov->lov_start_idx = ll_rand() % ost_count;
- lov->lov_start_count =
- (LOV_CREATE_RESEED_MIN / max(ost_active_count, 1U) +
- LOV_CREATE_RESEED_MULT) * max(ost_active_count, 1U);
- } else if (stripe_cnt_min >= ost_active_count ||
- lov->lov_start_idx > ost_count) {
+ pool = lov_find_pool(lov, poolname);
+ if (pool == NULL) {
+ osts = &(lov->lov_packed);
+ lqr = &(lov->lov_qos.lq_rr);
+ } else {
+ read_lock(&pool_tgt_rwlock(pool));
+ osts = &(pool->pool_obds);
+ lqr = &(pool->pool_rr);
+ }
+
+ rc = qos_calc_rr(lov, osts, lqr);
+ if (rc)
+ GOTO(out, rc);
+
+ if (--lqr->lqr_start_count <= 0) {
+ lqr->lqr_start_idx = ll_rand() % osts->op_count;
+ lqr->lqr_start_count =
+ (LOV_CREATE_RESEED_MIN / max(osts->op_count, 1U) +
+ LOV_CREATE_RESEED_MULT) * max(osts->op_count, 1U);
+ } else if (stripe_cnt_min >= osts->op_count ||
+ lqr->lqr_start_idx > osts->op_count) {