We don't want to export lnet_net2ni_locked because it requires
an extra parameter CPT number, which is internal to LNet and
confusing to user, also, no LND is using it/should use it, however,
LND does need lnet_net2ni() which is an inline function and it is
referring lnet_net2ni_locked(), which means it forces us to export
lnet_net2ni_locked.
The way to fix should be simple, we can just dis-inline lnet_net2ni()
and export itself instead of exporting lnet_net2ni_locked.
Signed-off-by: Liang Zhen <liang@whamcloud.com>
Change-Id: I251d42d47770211ae6238ee56972fb9aacd63599
Reviewed-on: http://review.whamcloud.com/3207
Reviewed-by: Bobi Jam <bobijam@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Doug Oucharek <doug@whamcloud.com>
Tested-by: Hudson
Tested-by: Maloo <whamcloud.maloo@gmail.com>
extern int lnet_cpt_of_nid(lnet_nid_t nid);
extern lnet_ni_t *lnet_nid2ni_locked(lnet_nid_t nid, int cpt);
extern lnet_ni_t *lnet_net2ni_locked(__u32 net, int cpt);
-static inline lnet_ni_t *
-lnet_net2ni(__u32 net)
-{
- lnet_ni_t *ni;
-
- lnet_net_lock(0);
- ni = lnet_net2ni_locked(net, 0);
- lnet_net_unlock(0);
-
- return ni;
-}
+extern lnet_ni_t *lnet_net2ni(__u32 net);
int lnet_notify(lnet_ni_t *ni, lnet_nid_t peer, int alive, cfs_time_t when);
void lnet_notify_locked(lnet_peer_t *lp, int notifylnd, int alive, cfs_time_t when);
return NULL;
}
+lnet_ni_t *
+lnet_net2ni(__u32 net)
+{
+ lnet_ni_t *ni;
+
+ lnet_net_lock(0);
+ ni = lnet_net2ni_locked(net, 0);
+ lnet_net_unlock(0);
+
+ return ni;
+}
+EXPORT_SYMBOL(lnet_net2ni);
+
static unsigned int
lnet_nid_cpt_hash(lnet_nid_t nid, unsigned int number)
{