#include <asm/div64.h>
#include <linux/seq_file.h>
#include <linux/namei.h>
+# ifndef HAVE_VFS_INTENT_PATCHES
+# include <linux/lustre_intent.h>
+# endif
#else
#include <liblustre.h>
#endif
int pmode, rc = 0;
ENTRY;
- body = lustre_msg_buf((*reqp)->rq_repmsg,
- DLM_REPLY_REC_OFF, sizeof(*body));
+ body = req_capsule_server_get(&(*reqp)->rq_pill, &RMF_DLM_REP);
LASSERT(body != NULL);
- LASSERT_REPSWABBED((*reqp), DLM_REPLY_REC_OFF);
if (!(body->valid & OBD_MD_MDS))
RETURN(0);
* For open with IT_CREATE and for IT_CREATE cases allocate new
* fid and setup FLD for it.
*/
+ /* save old child fid for correctly check stale data*/
+ sop_data->op_fid3 = sop_data->op_fid2;
rc = lmv_fid_alloc(exp, &sop_data->op_fid2, sop_data);
if (rc)
GOTO(out_free_sop_data, rc);
/* caller may use attrs MDS returns on IT_OPEN lock request so, we have
* to update them for split dir */
- body = lustre_msg_buf((*reqp)->rq_repmsg,
- DLM_REPLY_REC_OFF, sizeof(*body));
+ body = req_capsule_server_get(&(*reqp)->rq_pill, &RMF_DLM_REP);
LASSERT(body != NULL);
- LASSERT_REPSWABBED((*reqp), DLM_REPLY_REC_OFF);
/* could not find object, FID is not present in response. */
if (!(body->valid & OBD_MD_FLID))
GOTO(out_free_sop_data, rc = 0);
obj = lmv_obj_grab(obd, &body->fid1);
- if (!obj && (mea = lmv_get_mea(*reqp, DLM_REPLY_REC_OFF))) {
+ if (!obj && (mea = lmv_get_mea(*reqp))) {
/* FIXME: capability for remote! */
/* wow! this is split dir, we'd like to handle it */
obj = lmv_obj_create(exp, &body->fid1, mea);
LASSERT(*reqp);
LASSERT((*reqp)->rq_repmsg);
- body = lustre_msg_buf((*reqp)->rq_repmsg,
- DLM_REPLY_REC_OFF, sizeof(*body));
+ body = req_capsule_server_get(&(*reqp)->rq_pill, &RMF_MDT_BODY);
LASSERT(body != NULL);
- LASSERT_REPSWABBED((*reqp), DLM_REPLY_REC_OFF);
/* could not find object, FID is not present in response. */
if (!(body->valid & OBD_MD_FLID))
obj2 = lmv_obj_grab(obd, &body->fid1);
- if (!obj2 && (mea = lmv_get_mea(*reqp, DLM_REPLY_REC_OFF))) {
+ if (!obj2 && (mea = lmv_get_mea(*reqp))) {
/* FIXME remote capability! */
/* wow! this is split dir, we'd like to handle it. */
if (op_data == NULL)
RETURN(-ENOMEM);
- body = lustre_msg_buf((*reqp)->rq_repmsg,
- DLM_REPLY_REC_OFF, sizeof(*body));
+ body = req_capsule_server_get(&(*reqp)->rq_pill, &RMF_MDT_BODY);
LASSERT(body != NULL);
- LASSERT_REPSWABBED((*reqp), DLM_REPLY_REC_OFF);
LASSERT((body->valid & OBD_MD_FLID) != 0);
obj = lmv_obj_grab(obd, &body->fid1);
lock->l_ast_data = lmv_obj_get(obj);
- body2 = lustre_msg_buf(req->rq_repmsg,
- DLM_REPLY_REC_OFF, sizeof(*body2));
+ body2 = req_capsule_server_get(&req->rq_pill, &RMF_MDT_BODY);
LASSERT(body2 != NULL);
- LASSERT_REPSWABBED(req, DLM_REPLY_REC_OFF);
obj->lo_inodes[i].li_size = body2->size;
rc = lmv_intent_remote(exp, lmm, lmmsize, it, flags, reqp,
cb_blocking, extra_lock_flags);
- if (rc == 0 && (mea = lmv_get_mea(*reqp, DLM_REPLY_REC_OFF))) {
+ if (rc == 0 && (mea = lmv_get_mea(*reqp))) {
/* Wow! This is split dir, we'd like to handle it. */
- body = lustre_msg_buf((*reqp)->rq_repmsg,
- DLM_REPLY_REC_OFF, sizeof(*body));
+ body = req_capsule_server_get(&(*reqp)->rq_pill, &RMF_MDT_BODY);
LASSERT(body != NULL);
- LASSERT_REPSWABBED((*reqp), DLM_REPLY_REC_OFF);
LASSERT((body->valid & OBD_MD_FLID) != 0);
obj = lmv_obj_grab(obd, &body->fid1);
* It even got the reply refresh attrs
* from that reply.
*/
- body = lustre_msg_buf(mreq->rq_repmsg,
- DLM_REPLY_REC_OFF,
- sizeof(*body));
+ body = req_capsule_server_get(
+ &mreq->rq_pill,
+ &RMF_MDT_BODY);
LASSERT(body != NULL);
- LASSERT_REPSWABBED(mreq, DLM_REPLY_REC_OFF);
goto update;
}
/* take already cached attrs into account */
*reqp = req;
}
- body = lustre_msg_buf(req->rq_repmsg,
- DLM_REPLY_REC_OFF, sizeof(*body));
+ body = req_capsule_server_get(&req->rq_pill, &RMF_MDT_BODY);
LASSERT(body != NULL);
- LASSERT_REPSWABBED(req, DLM_REPLY_REC_OFF);
update:
obj->lo_inodes[i].li_size = body->size;
CDEBUG(D_OTHER, "return refreshed attrs: size = %lu\n",
(unsigned long)size);
- body = lustre_msg_buf((*reqp)->rq_repmsg,
- DLM_REPLY_REC_OFF, sizeof(*body));
+ body = req_capsule_server_get(&(*reqp)->rq_pill, &RMF_MDT_BODY);
LASSERT(body != NULL);
- LASSERT_REPSWABBED((*reqp), DLM_REPLY_REC_OFF);
body->size = size;