int LNetGetId(unsigned int index, struct lnet_processid *id);
int LNetDist(struct lnet_nid *nid, struct lnet_nid *srcnid, __u32 *order);
void LNetPrimaryNID(struct lnet_nid *nid);
-bool LNetIsPeerLocal(lnet_nid_t nid);
+bool LNetIsPeerLocal(struct lnet_nid *nid);
/** @} lnet_addr */
* \retval true If peer NID is on the local node.
* \retval false If peer NID is not on the local node.
*/
-bool LNetIsPeerLocal(lnet_nid_t nid)
+bool LNetIsPeerLocal(struct lnet_nid *nid)
{
struct lnet_net *net;
struct lnet_ni *ni;
cpt = lnet_net_lock_current();
list_for_each_entry(net, &the_lnet.ln_nets, net_list) {
list_for_each_entry(ni, &net->net_ni_list, ni_netlist) {
- if (lnet_nid_to_nid4(&ni->ni_nid) == nid) {
+ if (nid_same(&ni->ni_nid, nid)) {
lnet_net_unlock(cpt);
return true;
}
if (nid_same(&conn->c_peer.nid, &conn->c_self))
return true;
- RETURN(LNetIsPeerLocal(lnet_nid_to_nid4(&conn->c_peer.nid)));
+ RETURN(LNetIsPeerLocal(&conn->c_peer.nid));
}
/* ptlrpc/niobuf.c */
/* don't need to get local config */
if (cld_is_nodemap(cld) &&
- LNetIsPeerLocal(lnet_nid_to_nid4(&mgc_conn->c_peer.nid)))
+ LNetIsPeerLocal(&mgc_conn->c_peer.nid))
GOTO(out, rc = 0);
/* allocate buffer for bulk transfer.
if ((strcmp(exp->exp_obd->obd_type->typ_name,
LUSTRE_MGS_NAME) == 0) &&
(exp->exp_flvr.sf_rpc == SPTLRPC_FLVR_NULL ||
- LNetIsPeerLocal(lnet_nid_to_nid4(&exp->exp_connection->c_peer.nid))))
+ LNetIsPeerLocal(&exp->exp_connection->c_peer.nid)))
exp->exp_flvr.sf_rpc = SPTLRPC_FLVR_ANY;
if (exp->exp_flvr.sf_rpc != SPTLRPC_FLVR_ANY &&
struct lu_target *tgt = class_exp2tgt(exp);
struct tgt_session_info *tsi = tgt_ses_info(env);
struct ptlrpc_request *req = tgt_ses_req(tsi);
+ struct lnet_nid nid;
if (exp_connect_flags(exp) & OBD_CONNECT_MDS ||
exp_connect_flags(exp) & OBD_CONNECT_MDS_MDS)
return 0;
if (!req)
return 0;
- if (!LNetIsPeerLocal(req->rq_peer.nid))
+ lnet_nid4_to_nid(req->rq_peer.nid, &nid);
+ if (!LNetIsPeerLocal(&nid))
return 0;
return 1;