Whamcloud - gitweb
LU-12678 lnet: discard lnd_refcount 29/36829/2
authorMr NeilBrown <neilb@suse.de>
Sun, 24 Nov 2019 23:00:48 +0000 (10:00 +1100)
committerOleg Drokin <green@whamcloud.com>
Mon, 16 Dec 2019 06:00:05 +0000 (06:00 +0000)
commit6062999295090244874594db69a3dffa6f4f8a53
tree6e90e108c3d3e878a0585f6c058dc8ba35a94f07
parent298cdb5c0b6136b91e76c9c515bfbc2df99bae0b
LU-12678 lnet: discard lnd_refcount

The lnd_refcount in 'struct lnet_lnd' is never tested (except
in an ASSERT()), so it cannot be needed.  Let's remove it.

Each individual lnd keeps track of how many lnet_ni are
registered for that lnd e.g. ksocklnd has a counter in ksnd_nnets
and o2iblnd has a linked list in kib_devs.
They hold a reference on the module while there are registered
devices, and the lnd is only freed (and the lnd_refcount checked)
when the module is unloaded.  This confirms that lnd_refcount
adds no value.

Signed-off-by: Mr NeilBrown <neilb@suse.de>
Change-Id: I0d0c04051bf01a1fa77d888b00fb0a7875b09ccd
Reviewed-on: https://review.whamcloud.com/36829
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Serguei Smirnov <ssmirnov@whamcloud.com>
Reviewed-by: James Simmons <jsimmons@infradead.org>
Reviewed-by: Chris Horn <hornc@cray.com>
Reviewed-by: Amir Shehata <ashehata@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lnet/include/lnet/lib-types.h
lnet/lnet/api-ni.c