- if (tgt) {
- tmp = lustre_msg_buf(req->rq_reqmsg, 2);
- LOGL0(tgt, tgtlen, tmp);
+ /*
+ * mdc_create_pack() fills msg->bufs[1] with name and msg->bufs[2] with
+ * tgt, for symlinks or lov MD data.
+ */
+ mdc_create_pack(req, REQ_REC_OFF, op_data, data, datalen, mode, uid,
+ gid, cap_effective, rdev);
+
+ size[REPLY_REC_OFF] = sizeof(struct mdt_body);
+ size[REPLY_REC_OFF + 1] = sizeof(struct lustre_capa);
+ ptlrpc_req_set_repsize(req, 3, size);
+
+ level = LUSTRE_IMP_FULL;
+ resend:
+ rc = mdc_reint(req, obd->u.cli.cl_rpc_lock, level);
+
+ /* Resend if we were told to. */
+ if (rc == -ERESTARTSYS) {
+ level = LUSTRE_IMP_RECOVER;
+ goto resend;
+ } else if (rc == 0) {
+ struct mdt_body *body;
+ struct lustre_capa *capa;
+
+ body = lustre_msg_buf(req->rq_repmsg, REPLY_REC_OFF,
+ sizeof(*body));
+ LASSERT(body);
+ if (body->valid & OBD_MD_FLMDSCAPA) {
+ capa = lustre_unpack_capa(req->rq_repmsg,
+ REPLY_REC_OFF + 1);
+ if (capa == NULL) {
+ CERROR("Missing/short MDS capability\n");
+ rc = -EPROTO;
+ }
+ }