From: Mr NeilBrown Date: Mon, 28 Jun 2021 06:22:02 +0000 (+1000) Subject: LU-6142 lnet: discard lnet_current_net_count X-Git-Tag: 2.14.53~35 X-Git-Url: https://git.whamcloud.com/?a=commitdiff_plain;h=a39f07804153f4f120727a4decbece5db0ef5bef;p=fs%2Flustre-release.git LU-6142 lnet: discard lnet_current_net_count 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. Test-Parameters: trivial Signed-off-by: Mr NeilBrown Change-Id: Id61f381f6220356c5b96c8a5822d8748a8ba43a4 Reviewed-on: https://review.whamcloud.com/44089 Tested-by: jenkins Tested-by: Maloo Reviewed-by: James Simmons Reviewed-by: Serguei Smirnov Reviewed-by: Oleg Drokin --- diff --git a/lnet/include/lnet/lib-lnet.h b/lnet/include/lnet/lib-lnet.h index b419f9e..234451d 100644 --- a/lnet/include/lnet/lib-lnet.h +++ b/lnet/include/lnet/lib-lnet.h @@ -873,8 +873,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); -extern unsigned int lnet_current_net_count; struct lnet_peer_net *lnet_get_next_peer_net_locked(struct lnet_peer *lp, __u32 prev_lpn_id); diff --git a/lnet/lnet/api-ni.c b/lnet/lnet/api-ni.c index 835d96a..4b47457 100644 --- a/lnet/lnet/api-ni.c +++ b/lnet/lnet/api-ni.c @@ -253,8 +253,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 @@ -1751,23 +1749,6 @@ lnet_get_ni_count(void) 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) { @@ -2592,9 +2573,6 @@ lnet_startup_lndnet(struct lnet_net *net, struct lnet_lnd_tunables *tun) lnet_net_unlock(LNET_LOCK_EX); } - /* update net count */ - lnet_current_net_count = lnet_get_net_count(); - return ni_count; failed1: