/* ptlrpc/events.c */
extern int ptlrpc_uuid_to_peer(struct obd_uuid *uuid,
struct lnet_process_id *peer,
- struct lnet_nid *self);
+ struct lnet_nid *self,
+ u32 refnet);
/**
* These callbacks are invoked by LNet when something happened to
* underlying buffer
struct ptlrpc_client *);
void ptlrpc_cleanup_client(struct obd_import *imp);
struct ptlrpc_connection *ptlrpc_uuid_to_connection(struct obd_uuid *uuid,
- lnet_nid_t nid4refnet);
+ u32 refnet);
int ptlrpc_queue_wait(struct ptlrpc_request *req);
int ptlrpc_replay_req(struct ptlrpc_request *req);
{
struct ptlrpc_connection *ptlrpc_conn;
struct obd_import_conn *imp_conn = NULL, *item;
- lnet_nid_t nid4refnet = LNET_NID_ANY;
+ u32 refnet = LNET_NET_ANY;
int rc = 0;
ENTRY;
if (imp->imp_connection &&
imp->imp_connection->c_remote_uuid.uuid[0] == 0)
- /* nid4refnet is used to restrict network connections */
- nid4refnet = lnet_nid_to_nid4(&imp->imp_connection->c_self);
- ptlrpc_conn = ptlrpc_uuid_to_connection(uuid, nid4refnet);
+ /* refnet is used to restrict network connections */
+ refnet = LNET_NID_NET(&imp->imp_connection->c_self);
+ ptlrpc_conn = ptlrpc_uuid_to_connection(uuid, refnet);
if (!ptlrpc_conn) {
CDEBUG(D_HA, "can't find connection %s\n", uuid->uuid);
RETURN(-ENOENT);
struct ptlrpc_connection *ptlrpc_conn;
int rc;
- ptlrpc_conn = ptlrpc_uuid_to_connection(uuid, prim_nid);
+ ptlrpc_conn = ptlrpc_uuid_to_connection(uuid, LNET_NIDNET(prim_nid));
if (!ptlrpc_conn) {
const char *str_uuid = obd_uuid2str(uuid);
* Return PortalRPC connection for remore uud \a uuid
*/
struct ptlrpc_connection *ptlrpc_uuid_to_connection(struct obd_uuid *uuid,
- lnet_nid_t nid4refnet)
+ u32 refnet)
{
struct ptlrpc_connection *c;
struct lnet_nid self;
* before accessing its values.
*/
/* coverity[uninit_use_in_call] */
- peer.nid = nid4refnet;
- err = ptlrpc_uuid_to_peer(uuid, &peer, &self);
+ err = ptlrpc_uuid_to_peer(uuid, &peer, &self, refnet);
if (err != 0) {
CNETERR("cannot find peer %s!\n", uuid->uuid);
return NULL;
int ptlrpc_uuid_to_peer(struct obd_uuid *uuid,
struct lnet_process_id *peer,
- struct lnet_nid *self)
+ struct lnet_nid *self,
+ u32 refnet)
{
int best_dist = 0;
__u32 best_order = 0;
/* Choose the matching UUID that's closest */
while (lustre_uuid_to_peer(uuid->uuid, &dst_nid, count++) == 0) {
- if (peer->nid != LNET_NID_ANY && LNET_NIDADDR(peer->nid) == 0 &&
- LNET_NID_NET(&dst_nid) != LNET_NIDNET(peer->nid))
+ if (refnet != LNET_NET_ANY &&
+ LNET_NID_NET(&dst_nid) != refnet)
continue;
dist = LNetDist(&dst_nid, &src_nid, &order);