Whamcloud - gitweb
LU-9859 lnet: move ioctl device to lnet 33/50833/10
authorMr NeilBrown <neilb@suse.de>
Tue, 24 Nov 2020 00:42:44 +0000 (11:42 +1100)
committerOleg Drokin <green@whamcloud.com>
Wed, 19 Jul 2023 16:42:58 +0000 (16:42 +0000)
commit2d4d7febb124686d4a268197dfb36c9a478f8960
treeba46c53b0000bad1c63a86ff2dc7ec8c474d72d0
parent7154244354e3275f6a68f7581f7cfe9ef0a6507c
LU-9859 lnet: move ioctl device to lnet

The misc device "/dev/lnet" is currently managed in libcfs code,
despite that fact that it is named "lnet" and almost all ioctl
handlers are in lnet code.

So move the management of the device to lnet code, leaving just
the minimal amount in libcfs:
case IOC_LIBCFS_CLEAR_DEBUG:
case IOC_LIBCFS_MARK_DEBUG:

Also rename various parts of the interface from libcfs_ioctl* to
lnet_ioctl*.
ioctl names, data structures, and include files are left unchanged for
now.

Note that the return value from LNetCtl() was previously passed
through notifier_from_errno() and notifier_to_errno().  This had the
effect of turning any positive value to zero.  We need to preserve
that and not return positive results.  PING would return a positive
result.  lnd->lnd_ctl probably doesn't, but due to the difficulty of
auditing, it is safer to always force the result to non-positive.

Test-Parameters: trivial
Signed-off-by: Mr NeilBrown <neilb@suse.de>
Change-Id: I9cf158f1f9d8b03687d85ba40bd88f1f0ab8e4b8
Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/50833
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>
libcfs/include/libcfs/libcfs.h
libcfs/include/libcfs/util/ioctl.h
libcfs/libcfs/module.c
libcfs/libcfs/util/l_ioctl.c
lnet/include/lnet/lib-lnet.h
lnet/include/uapi/linux/lnet/libcfs_ioctl.h
lnet/lnet/api-ni.c
lnet/lnet/module.c
lnet/selftest/console.c