Whamcloud - gitweb
Branch HEAD
[fs/lustre-release.git] / lustre / lmv / lmv_obd.c
index dbebe38..2ac04ca 100644 (file)
@@ -1196,7 +1196,7 @@ static int lmv_getattr(struct obd_export *exp, const struct lu_fid *fid,
                 body = lustre_msg_buf((*request)->rq_repmsg, REPLY_REC_OFF,
                                       sizeof(*body));
                 LASSERT(body != NULL);
-                LASSERT_REPSWABBED((*request), REPLY_REC_OFF);
+                LASSERT(lustre_rep_swabbed(*request, REPLY_REC_OFF));
 
                 lmv_obj_lock(obj);
 
@@ -1248,7 +1248,7 @@ static int lmv_change_cbdata(struct obd_export *exp, const struct lu_fid *fid,
 
 static int lmv_close(struct obd_export *exp,
                      struct md_op_data *op_data,
-                     struct obd_client_handle *och,
+                     struct md_open_data *mod,
                      struct ptlrpc_request **request)
 {
         struct obd_device *obd = exp->exp_obd;
@@ -1266,7 +1266,7 @@ static int lmv_close(struct obd_export *exp,
                 RETURN(PTR_ERR(tgt_exp));
 
         CDEBUG(D_OTHER, "CLOSE "DFID"\n", PFID(&op_data->op_fid1));
-        rc = md_close(tgt_exp, op_data, och, request);
+        rc = md_close(tgt_exp, op_data, mod, request);
         RETURN(rc);
 }
 
@@ -1411,7 +1411,7 @@ repeat:
 
 static int lmv_done_writing(struct obd_export *exp,
                             struct md_op_data *op_data,
-                            struct obd_client_handle *och)
+                            struct md_open_data *mod)
 {
         struct obd_device *obd = exp->exp_obd;
         struct lmv_obd *lmv = &obd->u.lmv;
@@ -1427,7 +1427,7 @@ static int lmv_done_writing(struct obd_export *exp,
         if (IS_ERR(tgt_exp))
                 RETURN(PTR_ERR(tgt_exp));
 
-        rc = md_done_writing(tgt_exp, op_data, och);
+        rc = md_done_writing(tgt_exp, op_data, mod);
         RETURN(rc);
 }
 
@@ -1515,7 +1515,7 @@ lmv_enqueue_remote(struct obd_export *exp, struct ldlm_enqueue_info *einfo,
         body = lustre_msg_buf(req->rq_repmsg,
                               DLM_REPLY_REC_OFF, sizeof(*body));
         LASSERT(body != NULL);
-        LASSERT_REPSWABBED(req, DLM_REPLY_REC_OFF);
+        LASSERT(lustre_rep_swabbed(req, DLM_REPLY_REC_OFF));
 
         if (!(body->valid & OBD_MD_MDS))
                 RETURN(0);
@@ -1659,7 +1659,7 @@ repeat:
                 body = lustre_msg_buf((*request)->rq_repmsg,
                                       REQ_REC_OFF, sizeof(*body));
                 LASSERT(body != NULL);
-                LASSERT_REPSWABBED((*request), REQ_REC_OFF);
+                LASSERT(lustre_rep_swabbed(*request, REQ_REC_OFF));
 
                 if (body->valid & OBD_MD_MDS) {
                         struct ptlrpc_request *req = NULL;
@@ -2025,7 +2025,8 @@ request:
 
 static int lmv_setattr(struct obd_export *exp, struct md_op_data *op_data,
                        void *ea, int ealen, void *ea2, int ea2len,
-                       struct ptlrpc_request **request)
+                       struct ptlrpc_request **request,
+                       struct md_open_data **mod)
 {
         struct obd_device *obd = exp->exp_obd;
         struct lmv_obd *lmv = &obd->u.lmv;
@@ -2057,7 +2058,7 @@ static int lmv_setattr(struct obd_export *exp, struct md_op_data *op_data,
                         }
 
                         rc = md_setattr(tgt_exp, op_data, ea, ealen,
-                                        ea2, ea2len, &req);
+                                        ea2, ea2len, &req, mod);
 
                         if (lu_fid_eq(&obj->lo_fid, &obj->lo_inodes[i].li_fid)) {
                                 /*
@@ -2079,7 +2080,7 @@ static int lmv_setattr(struct obd_export *exp, struct md_op_data *op_data,
                         RETURN(PTR_ERR(tgt_exp));
 
                 rc = md_setattr(tgt_exp, op_data, ea, ealen, ea2,
-                                ea2len, request);
+                                ea2len, request, mod);
         }
         RETURN(rc);
 }
@@ -2709,14 +2710,15 @@ int lmv_set_lock_data(struct obd_export *exp, __u64 *lockh, void *data)
         RETURN(md_set_lock_data(lmv->tgts[0].ltd_exp, lockh, data));
 }
 
-int lmv_lock_match(struct obd_export *exp, int flags,
-                   const struct lu_fid *fid, ldlm_type_t type,
-                   ldlm_policy_data_t *policy, ldlm_mode_t mode,
-                   struct lustre_handle *lockh)
+ldlm_mode_t lmv_lock_match(struct obd_export *exp, int flags,
+                           const struct lu_fid *fid, ldlm_type_t type,
+                           ldlm_policy_data_t *policy, ldlm_mode_t mode,
+                           struct lustre_handle *lockh)
 {
         struct obd_device *obd = exp->exp_obd;
         struct lmv_obd *lmv = &obd->u.lmv;
-        int i, rc = 0;
+        ldlm_mode_t rc;
+        int i;
         ENTRY;
 
         CDEBUG(D_OTHER, "lock match for "DFID"\n", PFID(fid));
@@ -2729,10 +2731,10 @@ int lmv_lock_match(struct obd_export *exp, int flags,
                 rc = md_lock_match(lmv->tgts[i].ltd_exp, flags, fid,
                                    type, policy, mode, lockh);
                 if (rc)
-                        RETURN(1);
+                        RETURN(rc);
         }
 
-        RETURN(rc);
+        RETURN(0);
 }
 
 int lmv_get_lustre_md(struct obd_export *exp, struct ptlrpc_request *req,