Whamcloud - gitweb
LU-9859 libcfs: opencode cfs_cap_{raise,lower,raised} 04/36304/4
authorNeilBrown <neilb@suse.com>
Fri, 11 Oct 2019 14:38:45 +0000 (10:38 -0400)
committerOleg Drokin <green@whamcloud.com>
Fri, 6 Dec 2019 01:09:10 +0000 (01:09 +0000)
commitb88ba023ca23992a4fb98f337534d2997fabaf44
treeb6bb1bed3c8592e7582591aa3a2c6f5e47891889
parent2bf7e6baa4947f96b7fee6ee625d695e2f34c064
LU-9859 libcfs: opencode cfs_cap_{raise,lower,raised}

Each of these functions is used precisely once, so having
a separate exported function seems like overkill.

cfs_cap_raised() is trivial - one line.
cfs_cap_raise() and cfs_cap_lower() are used as a pair
which is more effectively implemented with
override_cred() / revert_creds().

Linux-commit: cc738c1a69da27be8ff7885b4069fa02e45c75c1

There exists a bug in the original Linux client patch.
Additionally handling the SYS_CAP_RESOURCE is used
extensively with the server code so create we can create
simple inline functions that handle this and it makes
the code cleaner.

Change-Id: I3a39a855fb9718ca43e74ef4b9e749b0f43f4bc8
Signed-off-by: NeilBrown <neilb@suse.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Reviewed-on: https://review.whamcloud.com/36304
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Neil Brown <neilb@suse.de>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Shaun Tancheff <stancheff@cray.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
libcfs/include/libcfs/curproc.h
libcfs/libcfs/linux/linux-curproc.c
lustre/obdclass/llog.c