RETURN(rc);
}
-int qos_del_tgt(struct obd_device *obd, __u32 index)
+int qos_del_tgt(struct obd_device *obd, struct lov_tgt_desc *tgt)
{
struct lov_obd *lov = &obd->u.lov;
struct lov_qos_oss *oss;
int rc = 0;
ENTRY;
- if (!lov->lov_tgts[index])
- RETURN(0);
-
down_write(&lov->lov_qos.lq_rw_sem);
- oss = lov->lov_tgts[index]->ltd_qos.ltq_oss;
+ oss = tgt->ltd_qos.ltq_oss;
if (!oss)
GOTO(out, rc = -ENOENT);
/* If each ost has almost same free space,
* do rr allocation for better creation performance */
lov->lov_qos.lq_same_space = 0;
- temp = ba_max - ba_min;
- ba_min = (ba_min * 51) >> 8; /* 51/256 = .20 */
- if (temp < ba_min) {
- /* Difference is less than 20% */
+ if ((ba_max * (256 - lov->lov_qos.lq_threshold_rr)) >> 8 < ba_min) {
lov->lov_qos.lq_same_space = 1;
/* Reset weights for the next time we enter qos mode */
lov->lov_qos.lq_reset = 1;
if (pool != NULL) {
up_read(&pool_tgt_rw_sem(pool));
/* put back ref got by lov_find_pool() */
- lh_put(lov->lov_pools_hash_body, &pool->pool_hash);
+ lov_pool_putref(pool);
}
RETURN(rc);
if (pool != NULL) {
up_read(&pool_tgt_rw_sem(pool));
/* put back ref got by lov_find_pool() */
- lh_put(lov->lov_pools_hash_body, &pool->pool_hash);
+ lov_pool_putref(pool);
}
RETURN(rc);
if (pool != NULL) {
up_read(&pool_tgt_rw_sem(pool));
/* put back ref got by lov_find_pool() */
- lh_put(lov->lov_pools_hash_body, &pool->pool_hash);
+ lov_pool_putref(pool);
}
if (rc == -EAGAIN)