From b98be5f6718ba963d703722620bd7c35912375cd Mon Sep 17 00:00:00 2001 From: Liang Zhen Date: Thu, 28 Jun 2012 09:52:38 +0800 Subject: [PATCH] LU-1577 lnet: should export lnet_net2ni 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 Change-Id: I251d42d47770211ae6238ee56972fb9aacd63599 Reviewed-on: http://review.whamcloud.com/3207 Reviewed-by: Bobi Jam Reviewed-by: Andreas Dilger Reviewed-by: Doug Oucharek Tested-by: Hudson Tested-by: Maloo --- lnet/include/lnet/lib-lnet.h | 12 +----------- lnet/lnet/api-ni.c | 13 +++++++++++++ 2 files changed, 14 insertions(+), 11 deletions(-) diff --git a/lnet/include/lnet/lib-lnet.h b/lnet/include/lnet/lib-lnet.h index ef2a5b23..bcdea8f 100644 --- a/lnet/include/lnet/lib-lnet.h +++ b/lnet/include/lnet/lib-lnet.h @@ -730,17 +730,7 @@ extern int lnet_cpt_of_nid_locked(lnet_nid_t nid); 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); diff --git a/lnet/lnet/api-ni.c b/lnet/lnet/api-ni.c index bdff15c..41c4a64 100644 --- a/lnet/lnet/api-ni.c +++ b/lnet/lnet/api-ni.c @@ -837,6 +837,19 @@ lnet_net2ni_locked(__u32 net, int cpt) 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) { -- 1.8.3.1