if (!lov->desc.ld_active_tgt_count)
RETURN(-EIO);
+ lov_getref(exp->exp_obd);
/* Recreate a specific object id at the given OST index */
if ((src_oa->o_valid & OBD_MD_FLFLAGS) &&
(src_oa->o_flags & OBD_FL_RECREATE_OBJS)) {
rc = lov_recreate(exp, src_oa, ea, oti);
- RETURN(rc);
+ GOTO(out, rc);
}
maxage = cfs_time_shift_64(-lov->desc.ld_qos_maxage);
rc = lov_prep_create_set(exp, &oinfo, ea, src_oa, oti, &set);
if (rc)
- RETURN(rc);
+ GOTO(out, rc);
list_for_each_entry(req, &set->set_list, rq_link) {
/* XXX: LOV STACKING: use real "obj_mdp" sub-data */
lov_update_create_set(set, req, rc);
}
rc = lov_fini_create_set(set, ea);
+out:
+ lov_putref(exp->exp_obd);
RETURN(rc);
}
}
lov = &exp->exp_obd->u.lov;
+ lov_getref(exp->exp_obd);
rc = lov_prep_destroy_set(exp, &oinfo, oa, lsm, oti, &set);
if (rc)
- RETURN(rc);
+ GOTO(out, rc);
list_for_each (pos, &set->set_list) {
int err;
rc = lsm_op_find(lsm->lsm_magic)->lsm_destroy(lsm, oa, md_exp);
}
err = lov_fini_destroy_set(set);
+out:
+ lov_putref(exp->exp_obd);
RETURN(rc ? rc : err);
}
/* Find a small number of stripes we can use
(up to # of active osts). */
stripes = 1;
- lov_getref(exp->exp_obd);
for (i = 0; i < lov->desc.ld_tgt_count; i++) {
if (!lov->lov_tgts[i] ||
!lov->lov_tgts[i]->ltd_active)
break;
stripes++;
}
- lov_putref(exp->exp_obd);
if (stripes < stripes_def)
stripes = stripes_def;