Whamcloud - gitweb
branch: HEAD
authorericm <ericm>
Mon, 22 Jun 2009 19:44:51 +0000 (19:44 +0000)
committerericm <ericm>
Mon, 22 Jun 2009 19:44:51 +0000 (19:44 +0000)
server save opc in replay_state thus we don't need to access repmsg after
reply being submmitted to ptlrpc.
b=19386
r=wangdi
r=fanyong

lustre/include/lustre_net.h
lustre/ldlm/ldlm_lib.c
lustre/mdt/mdt_recovery.c
lustre/ptlrpc/service.c

index 18d0df0..32b0291 100644 (file)
@@ -272,6 +272,7 @@ struct ptlrpc_reply_state {
         unsigned long          rs_prealloc:1; /* rs from prealloc list */
 
         int                    rs_size;
+        __u32                  rs_opc;
         __u64                  rs_transno;
         __u64                  rs_xid;
         struct obd_export     *rs_export;
index 32d9a4d..3391807 100644 (file)
@@ -2186,6 +2186,7 @@ void target_send_reply(struct ptlrpc_request *req, int rc, int fail_id)
         rs->rs_xid       = req->rq_xid;
         rs->rs_transno   = req->rq_transno;
         rs->rs_export    = exp;
+        rs->rs_opc       = lustre_msg_get_opc(rs->rs_msg);
 
         spin_lock(&exp->exp_uncommitted_replies_lock);
         CDEBUG(D_NET, "rs transno = "LPU64", last committed = "LPU64"\n",
index 0d794a1..0fa48af 100644 (file)
@@ -1013,12 +1013,11 @@ static void mdt_steal_ack_locks(struct ptlrpc_request *req)
                 if (oldrep->rs_xid != req->rq_xid)
                         continue;
 
-                if (lustre_msg_get_opc(oldrep->rs_msg) !=
-                    lustre_msg_get_opc(req->rq_reqmsg))
+                if (oldrep->rs_opc != lustre_msg_get_opc(req->rq_reqmsg))
                         CERROR ("Resent req xid "LPU64" has mismatched opc: "
                                 "new %d old %d\n", req->rq_xid,
                                 lustre_msg_get_opc(req->rq_reqmsg),
-                                lustre_msg_get_opc(oldrep->rs_msg));
+                                oldrep->rs_opc);
 
                 svc = oldrep->rs_service;
                 spin_lock (&svc->srv_lock);
@@ -1028,8 +1027,7 @@ static void mdt_steal_ack_locks(struct ptlrpc_request *req)
                 CWARN("Stealing %d locks from rs %p x"LPD64".t"LPD64
                       " o%d NID %s\n",
                       oldrep->rs_nlocks, oldrep,
-                      oldrep->rs_xid, oldrep->rs_transno,
-                      lustre_msg_get_opc(oldrep->rs_msg),
+                      oldrep->rs_xid, oldrep->rs_transno, oldrep->rs_opc,
                       libcfs_nid2str(exp->exp_connection->c_peer.nid));
 
                 for (i = 0; i < oldrep->rs_nlocks; i++)
index ba0dffa..bae2756 100644 (file)
@@ -1684,8 +1684,7 @@ ptlrpc_handle_rs (struct ptlrpc_reply_state *rs)
                 CWARN("All locks stolen from rs %p x"LPD64".t"LPD64
                       " o%d NID %s\n",
                       rs,
-                      rs->rs_xid, rs->rs_transno,
-                      lustre_msg_get_opc(rs->rs_msg),
+                      rs->rs_xid, rs->rs_transno, rs->rs_opc,
                       libcfs_nid2str(exp->exp_connection->c_peer.nid));
         }