X-Git-Url: https://git.whamcloud.com/?a=blobdiff_plain;f=lustre%2Fptlrpc%2Fconnection.c;h=9e19704276571f394cb0f83a7d39941336a12fce;hb=56a32318ff0509aaddb69466b4f17069c3f207b6;hp=646cb0721badd79a80f87a3e10fc9028157d478f;hpb=289e9caabec18e07df40f206b1000d91d9e305d7;p=fs%2Flustre-release.git diff --git a/lustre/ptlrpc/connection.c b/lustre/ptlrpc/connection.c index 646cb07..9e19704 100644 --- a/lustre/ptlrpc/connection.c +++ b/lustre/ptlrpc/connection.c @@ -67,7 +67,7 @@ struct ptlrpc_connection *ptlrpc_get_connection(struct ptlrpc_peer *peer, spin_lock(&conn_lock); list_for_each(tmp, &conn_list) { c = list_entry(tmp, struct ptlrpc_connection, c_link); - if (!memcmp(peer, &c->c_peer, sizeof(struct ptlrpc_peer)) && + 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 (!memcmp(peer, &c->c_peer, sizeof(struct ptlrpc_peer)) && + 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));