sysctl: introduce new proc handler proc_dobool
authorJia He <hejianet@gmail.com>
Tue, 3 Aug 2021 10:59:36 +0000 (12:59 +0200)
committerChuck Lever <chuck.lever@oracle.com>
Tue, 17 Aug 2021 15:47:53 +0000 (11:47 -0400)
commita2071573d6346819cc4e5787b4206f2184985160
tree29b4e98e0d31a6e0e2516595818769c216f5e9bb
parent5c11720767f70d34357d00a15ba5a0ad052c40fe
sysctl: introduce new proc handler proc_dobool

This is to let bool variable could be correctly displayed in
big/little endian sysctl procfs. sizeof(bool) is arch dependent,
proc_dobool should work in all arches.

Suggested-by: Pan Xinhui <xinhui@linux.vnet.ibm.com>
Signed-off-by: Jia He <hejianet@gmail.com>
[thuth: rebased the patch to the current kernel version]
Signed-off-by: Thomas Huth <thuth@redhat.com>
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
include/linux/sysctl.h
kernel/sysctl.c