ENTRY;
LASSERT(info->mti_object != NULL);
- CDEBUG(D_INODE, "getattr with lock for "DFID3"/%s, ldlm_rep = %p\n",
- PFID3(mdt_object_fid(parent)), name, ldlm_rep);
-
name = req_capsule_client_get(&info->mti_pill, &RMF_NAME);
if (name == NULL)
RETURN(-EFAULT);
+ CDEBUG(D_INODE, "getattr with lock for "DFID3"/%s, ldlm_rep = %p\n",
+ PFID3(mdt_object_fid(parent)), name, ldlm_rep);
+
intent_set_disposition(ldlm_rep, DISP_LOOKUP_EXECD);
if (strlen(name) == 0) {
/* only open the child. parent is on another node. */
for (i = 0, tmpcount = rdpg->rp_count;
i < rdpg->rp_npages; i++, tmpcount -= tmpsize) {
- tmpsize = min(tmpcount, CFS_PAGE_SIZE);
+ tmpsize = min_t(int, tmpcount, CFS_PAGE_SIZE);
ptlrpc_prep_bulk_page(desc, rdpg->rp_pages[i], 0, tmpsize);
}
RETURN(-EFAULT);
}
rdpg->rp_count = reqbody->nlink;
- rdpg->rp_npages = rdpg->rp_count + CFS_PAGE_SIZE - 1 >> CFS_PAGE_SHIFT;
+ rdpg->rp_npages = (rdpg->rp_count + CFS_PAGE_SIZE - 1)>> CFS_PAGE_SHIFT;
OBD_ALLOC(rdpg->rp_pages, rdpg->rp_npages * sizeof rdpg->rp_pages[0]);
if (rdpg->rp_pages == NULL)
RETURN(-ENOMEM);
intent_set_disposition(ldlm_rep, DISP_LOOKUP_EXECD);
lh = &info->mti_lh[MDT_LH_PARENT];
if (!(la->la_flags & MDS_OPEN_CREAT))
- lh->mlh_mode = LCK_PR;
+ lh->mlh_mode = LCK_CR;
else
- lh->mlh_mode = LCK_PW;
+ lh->mlh_mode = LCK_EX;
parent = mdt_object_find_lock(info, rr->rr_fid1, lh,
MDS_INODELOCK_UPDATE);
if (IS_ERR(parent))
/* step 1: lookup & lock the tgt dir */
lh_tgt = &info->mti_lh[MDT_LH_CHILD];
lh_tgtdir = &info->mti_lh[MDT_LH_PARENT];
- lh_tgtdir->mlh_mode = LCK_PW;
+ lh_tgtdir->mlh_mode = LCK_EX;
mtgtdir = mdt_object_find_lock(info, rr->rr_fid1, lh_tgtdir,
MDS_INODELOCK_UPDATE);
if (IS_ERR(mtgtdir))