* GPL HEADER END
*/
/*
- * Copyright (c) 2012, Intel Corporation.
+ * Copyright (c) 2012, 2013, Intel Corporation.
* Use is subject to license terms.
*
* lustre/mdt/mdt_lvb.c
RETURN(rc);
}
- if (lock->l_resource->lr_type != LDLM_IBITS ||
- !(lock->l_policy_data.l_inodebits.bits & MDS_INODELOCK_LAYOUT))
+ if (!ldlm_has_layout(lock))
RETURN(0);
/* layout lock will be granted to client, fill in lvb with layout */
/* XXX get fid by resource id. why don't include fid in ldlm_resource */
fid = &info->mti_tmp_fid2;
- fid_build_from_res_name(fid, &lock->l_resource->lr_name);
+ fid_extract_from_res_name(fid, &lock->l_resource->lr_name);
obj = mdt_object_find(&env, info->mti_mdt, fid);
if (IS_ERR(obj))
GOTO(out, rc = PTR_ERR(obj));
- if (mdt_object_exists(obj) <= 0)
+ if (!mdt_object_exists(obj) || mdt_object_remote(obj))
GOTO(out, rc = -ENOENT);
child = mdt_object_child(obj);
if (lvblen < rc) {
CERROR("%s: expected %d actual %d.\n",
- info->mti_exp->exp_obd->obd_name, rc, lvblen);
+ mdt_obd_name(mdt), rc, lvblen);
GOTO(out, rc = -ERANGE);
}