Whamcloud - gitweb
LU-12678 o2iblnd: convert peers hash table to hashtable.h
Using a hashtable.h hashtable, rather than bespoke code, has several
advantages:
- the table is comprised of hlist_head, rather than list_head, so
it consumes less memory (though we need to make it a little bigger
as it must be a power-of-2)
- there are existing macros for easily walking the whole table
- it uses a "real" hash function rather than "mod a prime number".
In some ways, rhashtable might be even better, but it can change the
ordering of objects in the table are arbitrary moments, and that could
hurt the user-space API. It also does not support the partitioned
walking that ksocknal_check_peer_timeouts() depends on.
Note that new peers are inserted at the top of a hash chain, rather
than appended at the end. I don't think that should be a problem.
Also various white-space cleanups etc.
Signed-off-by: Mr NeilBrown <neilb@suse.de>
Change-Id: I2917024835abdd327c7da11dee3fd369570a9671
Reviewed-on: https://review.whamcloud.com/39303
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Chris Horn <chris.horn@hpe.com>
Reviewed-by: James Simmons <jsimmons@infradead.org>
Reviewed-by: Oleg Drokin <green@whamcloud.com>