Whamcloud - gitweb
LU-13783 libcfs: support removal of kernel_setsockopt() 59/39259/7
authorMr NeilBrown <neilb@suse.de>
Fri, 3 Jul 2020 03:51:50 +0000 (13:51 +1000)
committerOleg Drokin <green@whamcloud.com>
Wed, 10 Mar 2021 08:02:38 +0000 (08:02 +0000)
commit99d9638d6c074b48f1c21c5c94d6dfe347eed3ee
tree7fea753af6c9d53c66fb638277fd9ce250fd844a
parentc6d5c6606a38e2b550a81591935b0091faba4a2e
LU-13783 libcfs: support removal of kernel_setsockopt()

Linux 5.8 removes kernel_setsockopt() and kernel_getsockopt(), and
provides some helper functions for some accesses that are
not trivial.

This patch adds those helpers to libcfs when they are not available,
and changes (nearly) all calls to kernel_[gs]etsockopt() to
either use direct access to a helper call.

->keepalive() is not available before v4.11-rc1~94^2~43^2~14
and there is no helper function, so for SO_KEEPALIVE we
need to have #ifdef code in the C file.

TCP_BACKOFF* setting are not converted as they are not available in
any upstream kernel, so no conversion is possible.

Also include some minor style fixes and change lnet_sock_setbuf() and
lnet_sock_getbuf() to be 'void' functions.

Test-Parameters: trivial
Signed-off-by: Mr NeilBrown <neilb@suse.de>
Change-Id: I539cf8d20555ddb3565fa75130fdd3acf709c545
Reviewed-on: https://review.whamcloud.com/39259
Tested-by: jenkins <devops@whamcloud.com>
Reviewed-by: Aurelien Degremont <degremoa@amazon.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>
libcfs/autoconf/lustre-libcfs.m4
libcfs/include/libcfs/linux/Makefile.am
libcfs/include/libcfs/linux/linux-net.h [new file with mode: 0644]
lnet/include/lnet/lib-lnet.h
lnet/klnds/socklnd/socklnd.h
lnet/klnds/socklnd/socklnd_lib.c
lnet/lnet/lib-socket.c