OBD_FREE_PTR(op_data);
EXIT;
out:
- if (pmode)
+ if (rc && pmode)
ldlm_lock_decref(&plock, pmode);
ptlrpc_req_finished(*reqp);
int extra_lock_flags)
{
struct obd_device *obd = exp->exp_obd;
- struct lmv_obd *lmv = &obd->u.lmv;
const char *name = op_data->name;
int len = op_data->namelen;
struct lu_fid *pid, *cid;
pid = &op_data->fid1;
- cid = !fid_is_sane(&op_data->fid2) ?
- &op_data->fid2 : NULL;
+ cid = fid_is_sane(&op_data->fid2) ? &op_data->fid2 : NULL;
CDEBUG(D_OTHER, "INTENT LOCK '%s' for '%*s' on "DFID"\n",
LL_IT2STR(it), len, name, PFID(pid));
* balanced, that is all sequences have more or less equal
* number of objects created. */
if (hint->ph_cname && (hint->ph_opc == LUSTRE_OPC_MKDIR)) {
+#if 0
*mds = lmv_all_chars_policy(lmv->desc.ld_tgt_count,
hint->ph_cname);
rc = 0;
+#else
+ /* stress policy for tests - to use non-parent MDS */
+ LASSERT(fid_is_sane(hint->ph_pfid));
+ rc = lmv_fld_lookup(lmv, hint->ph_pfid, mds);
+ *mds = (int)(*mds + 1) % lmv->desc.ld_tgt_count;
+
+#endif
} else {
/* default policy is to use parent MDS */
LASSERT(fid_is_sane(hint->ph_pfid));
op_data->name, op_data->namelen);
op_data->fid1 = obj->lo_inodes[i].li_fid;
lmv_obj_put(obj);
+ CDEBUG(D_OTHER, "unlink '%*s' in "DFID" -> %u\n",
+ op_data->namelen, op_data->name,
+ PFID(&op_data->fid1), i);
}
- CDEBUG(D_OTHER, "unlink '%*s' in "DFID" -> %u\n",
- op_data->namelen, op_data->name, PFID(&op_data->fid1),
- i);
} else {
CDEBUG(D_OTHER, "drop i_nlink on "DFID"\n",
PFID(&op_data->fid1));