Whamcloud - gitweb
LU-1577 lnet: should export lnet_net2ni
authorLiang Zhen <liang@whamcloud.com>
Thu, 28 Jun 2012 01:52:38 +0000 (09:52 +0800)
committerAndreas Dilger <adilger@whamcloud.com>
Fri, 29 Jun 2012 09:40:05 +0000 (05:40 -0400)
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>
lnet/include/lnet/lib-lnet.h
lnet/lnet/api-ni.c

index ef2a5b2..bcdea8f 100644 (file)
@@ -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);
index bdff15c..41c4a64 100644 (file)
@@ -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)
 {