[lustre-devel] [PATCH 03/25] lnet: discard lnet_current_net_count

James Simmons jsimmons at infradead.org
Mon Aug 2 12:50:23 PDT 2021


From: Mr NeilBrown <neilb at suse.de>

The variable lnet_current_net_count is never used.  So remove it.
The function lnet_get_net_count() is only used to update thar
variable, so remove it too.

WC-bug-id: https://jira.whamcloud.com/browse/LU-6142
Lsutre-commit: a39f07804153f4f4 ("LU-6142 lnet: discard lnet_current_net_count")
Signed-off-by: Mr NeilBrown <neilb at suse.de>
Reviewed-on: https://review.whamcloud.com/44089
Reviewed-by: James Simmons <jsimmons at infradead.org>
Reviewed-by: Serguei Smirnov <ssmirnov at whamcloud.com>
Reviewed-by: Oleg Drokin <green at whamcloud.com>
Signed-off-by: James Simmons <jsimmons at infradead.org>
---
 include/linux/lnet/lib-lnet.h |  1 -
 net/lnet/lnet/api-ni.c        | 22 ----------------------
 2 files changed, 23 deletions(-)

diff --git a/include/linux/lnet/lib-lnet.h b/include/linux/lnet/lib-lnet.h
index f56ecab..3677a12 100644
--- a/include/linux/lnet/lib-lnet.h
+++ b/include/linux/lnet/lib-lnet.h
@@ -804,7 +804,6 @@ bool lnet_net_unique(u32 net_id, struct list_head *nilist,
 bool lnet_ni_unique_net(struct list_head *nilist, char *iface);
 void lnet_incr_dlc_seq(void);
 u32 lnet_get_dlc_seq_locked(void);
-int lnet_get_net_count(void);
 
 struct lnet_peer_net *lnet_get_next_peer_net_locked(struct lnet_peer *lp,
 						    u32 prev_lpn_id);
diff --git a/net/lnet/lnet/api-ni.c b/net/lnet/lnet/api-ni.c
index dc9020d..ec28139 100644
--- a/net/lnet/lnet/api-ni.c
+++ b/net/lnet/lnet/api-ni.c
@@ -196,8 +196,6 @@ static void lnet_set_lnd_timeout(void)
 			   (lnet_retry_count + 1);
 }
 
-unsigned int lnet_current_net_count;
-
 /*
  * This sequence number keeps track of how many times DLC was used to
  * update the local NIs. It is incremented when a NI is added or
@@ -1671,23 +1669,6 @@ struct lnet_ping_buffer *
 	return count;
 }
 
-int
-lnet_get_net_count(void)
-{
-	struct lnet_net *net;
-	int count = 0;
-
-	lnet_net_lock(0);
-
-	list_for_each_entry(net, &the_lnet.ln_nets, net_list) {
-		count++;
-	}
-
-	lnet_net_unlock(0);
-
-	return count;
-}
-
 void
 lnet_swap_pinginfo(struct lnet_ping_buffer *pbuf)
 {
@@ -2516,9 +2497,6 @@ static void lnet_push_target_fini(void)
 		lnet_net_unlock(LNET_LOCK_EX);
 	}
 
-	/* update net count */
-	lnet_current_net_count = lnet_get_net_count();
-
 	return ni_count;
 
 failed1:
-- 
1.8.3.1



More information about the lustre-devel mailing list