Whamcloud - gitweb
Land from b_hd_pid to HEAD
[fs/lustre-release.git] / lustre / ptlrpc / niobuf.c
index b628216..e8e4660 100644 (file)
@@ -34,7 +34,6 @@ static int ptl_send_buf (ptl_handle_md_t *mdh, void *base, int len,
                          ptl_ack_req_t ack, struct ptlrpc_cb_id *cbid,
                          struct ptlrpc_connection *conn, int portal, __u64 xid)
 {
-        ptl_process_id_t remote_id;
         int              rc;
         int              rc2;
         ptl_md_t         md;
@@ -43,14 +42,10 @@ static int ptl_send_buf (ptl_handle_md_t *mdh, void *base, int len,
 
         LASSERT (portal != 0);
         LASSERT (conn != NULL);
-        CDEBUG (D_INFO, "conn=%p ni %s nid %s on %s\n",
+        CDEBUG (D_INFO, "conn=%p ni %s id %s on %s\n",
                 conn, conn->c_peer.peer_ni->pni_name,
-                ptlrpc_peernid2str(&conn->c_peer, str),
+                ptlrpc_id2str(&conn->c_peer, str),
                 conn->c_peer.peer_ni->pni_name);
-
-        remote_id.nid = conn->c_peer.peer_nid,
-        remote_id.pid = 0;
-
         md.start     = base;
         md.length    = len;
         md.threshold = (ack == PTL_ACK_REQ) ? 2 : 1;
@@ -76,13 +71,13 @@ static int ptl_send_buf (ptl_handle_md_t *mdh, void *base, int len,
         CDEBUG(D_NET, "Sending %d bytes to portal %d, xid "LPD64"\n",
                len, portal, xid);
 
-        rc2 = PtlPut (*mdh, ack, remote_id, portal, 0, xid, 0, 0);
+        rc = PtlPut (*mdh, ack, conn->c_peer.peer_id, portal, 0, xid, 0, 0);
         if (rc != PTL_OK) {
                 /* We're going to get an UNLINK event when I unlink below,
                  * which will complete just like any other failed send, so
                  * I fall through and return success here! */
                 CERROR("PtlPut(%s, %d, "LPD64") failed: %d\n",
-                       ptlrpc_peernid2str(&conn->c_peer, str),
+                       ptlrpc_id2str(&conn->c_peer, str),
                        portal, xid, rc);
                 rc2 = PtlMDUnlink(*mdh);
                 LASSERT (rc2 == PTL_OK);
@@ -96,7 +91,6 @@ int ptlrpc_start_bulk_transfer (struct ptlrpc_bulk_desc *desc)
         int                 rc;
         int                 rc2;
         struct ptlrpc_peer *peer;
-        ptl_process_id_t    remote_id;
         ptl_md_t            md;
         __u64               xid;
         char                str[PTL_NALFMT_SIZE];
@@ -134,22 +128,19 @@ int ptlrpc_start_bulk_transfer (struct ptlrpc_bulk_desc *desc)
 
         /* Client's bulk and reply matchbits are the same */
         xid = desc->bd_req->rq_xid;
-        remote_id.nid = peer->peer_nid;
-        remote_id.pid = 0;
-
         CDEBUG(D_NET, "Transferring %u pages %u bytes via portal %d on %s "
                "nid %s pid %d xid "LPX64"\n", desc->bd_iov_count,
                desc->bd_nob, desc->bd_portal, peer->peer_ni->pni_name,
-               ptlrpc_peernid2str(peer, str), remote_id.pid, xid);
+               ptlrpc_id2str(peer, str), peer->peer_id.pid, xid);
 
         /* Network is about to get at the memory */
         desc->bd_network_rw = 1;
 
         if (desc->bd_type == BULK_PUT_SOURCE)
-                rc = PtlPut (desc->bd_md_h, PTL_ACK_REQ, remote_id,
+                rc = PtlPut (desc->bd_md_h, PTL_ACK_REQ, peer->peer_id,
                              desc->bd_portal, 0, xid, 0, 0);
         else
-                rc = PtlGet (desc->bd_md_h, remote_id,
+                rc = PtlGet (desc->bd_md_h, peer->peer_id,
                              desc->bd_portal, 0, xid, 0);
         
         if (rc != PTL_OK) {
@@ -157,7 +148,7 @@ int ptlrpc_start_bulk_transfer (struct ptlrpc_bulk_desc *desc)
                  * event this creates will signal completion with failure,
                  * so we return SUCCESS here! */
                 CERROR("Transfer(%s, %d, "LPX64") failed: %d\n",
-                       ptlrpc_peernid2str(peer, str),
+                       ptlrpc_id2str(peer, str),
                        desc->bd_portal, xid, rc);
                 rc2 = PtlMDUnlink(desc->bd_md_h);
                 LASSERT (rc2 == PTL_OK);
@@ -205,7 +196,6 @@ int ptlrpc_register_bulk (struct ptlrpc_request *req)
         struct ptlrpc_peer *peer;
         int rc;
         int rc2;
-        ptl_process_id_t source_id;
         ptl_handle_me_t  me_h;
         ptl_md_t         md;
         ENTRY;
@@ -242,13 +232,10 @@ int ptlrpc_register_bulk (struct ptlrpc_request *req)
         LASSERT (!desc->bd_registered || req->rq_xid != desc->bd_last_xid);
         desc->bd_registered = 1;
         desc->bd_last_xid = req->rq_xid;
-
-        source_id.nid = desc->bd_import->imp_connection->c_peer.peer_nid;
-        source_id.pid = PTL_PID_ANY;
-
+        
         rc = PtlMEAttach(peer->peer_ni->pni_ni_h,
-                         desc->bd_portal, source_id, req->rq_xid, 0,
-                         PTL_UNLINK, PTL_INS_AFTER, &me_h);
+                         desc->bd_portal, desc->bd_import->imp_connection->c_peer.peer_id, 
+                         req->rq_xid, 0, PTL_UNLINK, PTL_INS_AFTER, &me_h);
         if (rc != PTL_OK) {
                 CERROR("PtlMEAttach failed: %d\n", rc);
                 LASSERT (rc == PTL_NO_SPACE);
@@ -397,7 +384,6 @@ int ptl_send_rpc(struct ptlrpc_request *request)
         int rc2;
         struct ptlrpc_connection *connection;
         unsigned long flags;
-        ptl_process_id_t source_id;
         ptl_handle_me_t  reply_me_h;
         ptl_md_t         reply_md;
         ENTRY;
@@ -419,10 +405,7 @@ int ptl_send_rpc(struct ptlrpc_request *request)
         request->rq_reqmsg->handle = request->rq_import->imp_remote_handle;
         request->rq_reqmsg->type = PTL_RPC_MSG_REQUEST;
         request->rq_reqmsg->conn_cnt = request->rq_import->imp_conn_cnt;
-
-        source_id.nid = connection->c_peer.peer_nid;
-        source_id.pid = PTL_PID_ANY;
-
+                
         LASSERT (request->rq_replen != 0);
         if (request->rq_repmsg == NULL)
                 OBD_ALLOC(request->rq_repmsg, request->rq_replen);
@@ -431,7 +414,7 @@ int ptl_send_rpc(struct ptlrpc_request *request)
 
         rc = PtlMEAttach(connection->c_peer.peer_ni->pni_ni_h,
                          request->rq_reply_portal, /* XXX FIXME bug 249 */
-                         source_id, request->rq_xid, 0, PTL_UNLINK,
+                         connection->c_peer.peer_id, request->rq_xid, 0, PTL_UNLINK,
                          PTL_INS_AFTER, &reply_me_h);
         if (rc != PTL_OK) {
                 CERROR("PtlMEAttach failed: %d\n", rc);