@@ -487,7 +487,7 @@ int client_obd_setup(struct obd_device *obd, struct lustre_cfg *lcfg)
if (lustre_cfg_buf(lcfg, 4)) {
u32 refnet = libcfs_str2net(lustre_cfg_string(lcfg, 4));
- if (refnet == LNET_NIDNET(LNET_NID_ANY)) {
+ if (refnet == LNET_NET_ANY) {
rc = -EINVAL;
CERROR("%s: bad mount option 'network=%s': rc = %d\n",
obd->obd_name, lustre_cfg_string(lcfg, 4),
@@ -145,7 +145,7 @@ static void get_default_flavor(struct sptlrpc_flavor *sf)
static void sptlrpc_rule_init(struct sptlrpc_rule *rule)
{
- rule->sr_netid = LNET_NIDNET(LNET_NID_ANY);
+ rule->sr_netid = LNET_NET_ANY;
rule->sr_from = LUSTRE_SP_ANY;
rule->sr_to = LUSTRE_SP_ANY;
rule->sr_padding = 0;
@@ -177,7 +177,7 @@ static int sptlrpc_parse_rule(char *param, struct sptlrpc_rule *rule)
/* 1.1 network */
if (strcmp(param, "default")) {
rule->sr_netid = libcfs_str2net(param);
- if (rule->sr_netid == LNET_NIDNET(LNET_NID_ANY)) {
+ if (rule->sr_netid == LNET_NET_ANY) {
CERROR("invalid network name: %s\n", param);
return -EINVAL;
}
@@ -263,7 +263,7 @@ static inline int rule_spec_dir(struct sptlrpc_rule *rule)
static inline int rule_spec_net(struct sptlrpc_rule *rule)
{
- return (rule->sr_netid != LNET_NIDNET(LNET_NID_ANY));
+ return (rule->sr_netid != LNET_NET_ANY);
}
static inline int rule_match_dir(struct sptlrpc_rule *r1,
@@ -384,8 +384,8 @@ static int sptlrpc_rule_set_choose(struct sptlrpc_rule_set *rset,
for (n = 0; n < rset->srs_nrule; n++) {
r = &rset->srs_rules[n];
- if (LNET_NIDNET(nid) != LNET_NIDNET(LNET_NID_ANY) &&
- r->sr_netid != LNET_NIDNET(LNET_NID_ANY) &&
+ if (LNET_NIDNET(nid) != LNET_NET_ANY &&
+ r->sr_netid != LNET_NET_ANY &&
LNET_NIDNET(nid) != r->sr_netid)
continue;
@@ -112,6 +112,8 @@ static inline __u32 LNET_MKNET(__u32 type, __u32 num)
/** The lolnd NID (i.e. myself) */
#define LNET_NID_LO_0 LNET_MKNID(LNET_MKNET(LOLND, 0), 0)
+#define LNET_NET_ANY LNET_NIDNET(LNET_NID_ANY)
+
/* Packed version of lnet_process_id to transfer via network */
struct lnet_process_id_packed {
/* node id / process id */
@@ -679,7 +679,7 @@ struct lnet_ni *
* At this point the name is properly terminated.
*/
net_id = libcfs_str2net(name);
- if (net_id == LNET_NIDNET(LNET_NID_ANY)) {
+ if (net_id == LNET_NET_ANY) {
LCONSOLE_ERROR_MSG(0x113,
"Unrecognised network type\n");
str = name;
@@ -1169,7 +1169,7 @@ struct lnet_ni *
if (ntokens == 1) {
net = libcfs_str2net(ltb->ltb_text);
- if (net == LNET_NIDNET(LNET_NID_ANY) ||
+ if (net == LNET_NET_ANY ||
LNET_NETTYP(net) == LOLND)
goto token_error;
} else {
@@ -1197,7 +1197,7 @@ struct lnet_ni *
list_for_each_entry(ltb1, &nets, ltb_list) {
net = libcfs_str2net(ltb1->ltb_text);
- LASSERT(net != LNET_NIDNET(LNET_NID_ANY));
+ LASSERT(net != LNET_NET_ANY);
list_for_each_entry(ltb2, &gateways, ltb_list) {
nid = libcfs_str2nid(ltb2->ltb_text);
@@ -1403,7 +1403,7 @@ struct lnet_ni *
*sep++ = 0;
net = lnet_netspec2net(tb->ltb_text);
- if (net == LNET_NIDNET(LNET_NID_ANY)) {
+ if (net == LNET_NET_ANY) {
lnet_syntax("ip2nets", source, offset,
strlen(tb->ltb_text));
return -EINVAL;
@@ -1222,10 +1222,9 @@ void lnet_usr_translate_stats(struct lnet_ioctl_element_msg_stats *msg_stats,
struct lnet_peer *peer, u32 net_id)
{
struct lnet_peer_net *peer_net;
- u32 any_net = LNET_NIDNET(LNET_NID_ANY);
/* find the best_lpni on any local network */
- if (net_id == any_net) {
+ if (net_id == LNET_NET_ANY) {
struct lnet_peer_ni *best_lpni = NULL;
struct lnet_peer_net *lpn;
@@ -884,7 +884,7 @@ int cfs_print_nidlist(char *buffer, int count, struct list_head *nidlist)
if (libcfs_str2net_internal(str, &net))
return net;
- return LNET_NIDNET(LNET_NID_ANY);
+ return LNET_NET_ANY;
}
EXPORT_SYMBOL(libcfs_str2net);
@@ -596,7 +596,7 @@ void lnet_peer_uninit(void)
gw_nid = lp->lpni_peer_net->lpn_peer->lp_primary_nid;
lnet_net_unlock(LNET_LOCK_EX);
- lnet_del_route(LNET_NIDNET(LNET_NID_ANY), gw_nid);
+ lnet_del_route(LNET_NET_ANY, gw_nid);
lnet_net_lock(LNET_LOCK_EX);
}
}
@@ -664,7 +664,7 @@ static void lnet_shuffle_seed(void)
if (gateway == LNET_NID_ANY ||
gateway == LNET_NID_LO_0 ||
- net == LNET_NIDNET(LNET_NID_ANY) ||
+ net == LNET_NET_ANY ||
LNET_NETTYP(net) == LOLND ||
LNET_NIDNET(gateway) == net ||
(hops != LNET_UNDEFINED_HOPS && (hops < 1 || hops > 255)))
@@ -841,7 +841,7 @@ static void lnet_shuffle_seed(void)
lnet_peer_ni_decref_locked(lpni);
}
- if (net != LNET_NIDNET(LNET_NID_ANY)) {
+ if (net != LNET_NET_ANY) {
rnet = lnet_find_rnet_locked(net);
if (!rnet) {
lnet_net_unlock(LNET_LOCK_EX);
@@ -898,7 +898,7 @@ static void lnet_shuffle_seed(void)
void
lnet_destroy_routes(void)
{
- lnet_del_route(LNET_NIDNET(LNET_NID_ANY), LNET_NID_ANY);
+ lnet_del_route(LNET_NET_ANY, LNET_NID_ANY);
}
int lnet_get_rtr_pool_cfg(int cpt, struct lnet_ioctl_pool_cfg *pool_cfg)