ENTRY;
mci = mdc_info_init(ctx);
- mci->mci_opdata.fid1 = *lu_object_fid(&mo->mo_lu);
+ mci->mci_opdata.fid2 = *lu_object_fid(&mo->mo_lu);
+ /* parent fid is needed to create dotdot on the remote node */
+ mci->mci_opdata.fid1 = *(spec->u.sp_pfid);
mci->mci_opdata.mod_time = la->la_mtime;
/* get data from spec */
attr->la_valid = LA_MODE | LA_RDEV | LA_UID | LA_GID |
LA_CTIME | LA_MTIME | LA_ATIME;
info->mti_spec.sp_cr_flags = rec->cr_flags;
-
+
rr->rr_name = req_capsule_client_get(pill, &RMF_NAME);
- if (rr->rr_name) {
+ if (S_ISDIR(attr->la_mode)) {
+ /* pass parent fid for cross-ref cases */
+ info->mti_spec.u.sp_pfid = rr->rr_fid1;
+ } else if (S_ISLNK(attr->la_mode)) {
+ const char *tgt = NULL;
if (req_capsule_field_present(pill, &RMF_SYMTGT)) {
- const char *tgt;
tgt = req_capsule_client_get(pill,
&RMF_SYMTGT);
- if (tgt == NULL)
- result = -EFAULT;
info->mti_spec.u.sp_symname = tgt;
}
- } else
- result = -EFAULT;
+ if (tgt == NULL)
+ result = -EFAULT;
+ }
} else
result = -EFAULT;
RETURN(result);
repbody = req_capsule_server_get(&info->mti_pill, &RMF_MDT_BODY);
- o = mdt_object_find(info->mti_ctxt, mdt, info->mti_rr.rr_fid1);
+ o = mdt_object_find(info->mti_ctxt, mdt, info->mti_rr.rr_fid2);
if (!IS_ERR(o)) {
struct md_object *next = mdt_object_child(o);
rr->rr_fid2, rr->rr_tgt);
else
rc = mdo_name_insert(info->mti_ctxt, mdt_object_child(mtgtdir),
- rr->rr_tgt, rr->rr_fid2);
+ rr->rr_tgt, rr->rr_fid2, 0 /* FIXME */);
GOTO(out_unlock_tgt, rc);
out_unlock_tgt: