Whamcloud - gitweb
drop truncate capa after ll_truncate.
[fs/lustre-release.git] / lustre / ptlrpc / connection.c
index 2e0d889..9e19704 100644 (file)
@@ -62,12 +62,12 @@ struct ptlrpc_connection *ptlrpc_get_connection(struct ptlrpc_peer *peer,
 
 
         CDEBUG(D_INFO, "peer is %s on %s\n",
-               ptlrpc_peernid2str(peer, str), peer->peer_ni->pni_name);
+               ptlrpc_id2str(peer, str), peer->peer_ni->pni_name);
 
         spin_lock(&conn_lock);
         list_for_each(tmp, &conn_list) {
                 c = list_entry(tmp, struct ptlrpc_connection, c_link);
-                if (peer->peer_nid == c->c_peer.peer_nid &&
+                if (memcmp(peer, &c->c_peer, sizeof(*peer)) == 0 &&
                     peer->peer_ni == c->c_peer.peer_ni) {
                         ptlrpc_connection_addref(c);
                         GOTO(out, c);
@@ -76,7 +76,7 @@ struct ptlrpc_connection *ptlrpc_get_connection(struct ptlrpc_peer *peer,
 
         list_for_each_safe(tmp, pos, &conn_unused_list) {
                 c = list_entry(tmp, struct ptlrpc_connection, c_link);
-                if (peer->peer_nid == c->c_peer.peer_nid &&
+                if (memcmp(peer, &c->c_peer, sizeof(*peer)) == 0 &&
                     peer->peer_ni == c->c_peer.peer_ni) {
                         ptlrpc_connection_addref(c);
                         list_del(&c->c_link);
@@ -93,7 +93,7 @@ struct ptlrpc_connection *ptlrpc_get_connection(struct ptlrpc_peer *peer,
                 GOTO(out, c);
 
         if (uuid && uuid->uuid)                         /* XXX ???? */
-                obd_str2uuid(&c->c_remote_uuid, uuid->uuid);
+                obd_str2uuid(&c->c_remote_uuid, (char *)uuid->uuid);
         atomic_set(&c->c_refcount, 0);
         memcpy(&c->c_peer, peer, sizeof(c->c_peer));