Whamcloud - gitweb
LU-12678 lnet: prepare to make lnet_lnd const.
Preferred practice is for structs containing function
pointers to be 'const'. Such structs are generally tempting
attack vectors, and making them const allows linux to place
them in read-only memory, thus reducing the attack surface.
'struct lnet_lnd' is mostly function pointers, but contains
one writable field - a list_head.
Rather than keeping registered lnds in a linked-list, we can place
them in an array indexed by type - type numbers are at most 15 so
this is not a burden.
With these changes, no part of an lnet_lnd is ever modified.
Test-Parameters: trivial
Test-Parameters: testlist=sanity-lnet
Signed-off-by: Mr NeilBrown <neilb@suse.com>
Change-Id: I08c7df551109e05ca4a3cef866e8df737d1a1ad4
Reviewed-on: https://review.whamcloud.com/36830
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: James Simmons <jsimmons@infradead.org>
Reviewed-by: Serguei Smirnov <ssmirnov@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>