From 6aee58cec5d08a48f3545d2c3def36a32149f1d3 Mon Sep 17 00:00:00 2001 From: James Simmons Date: Fri, 11 Aug 2017 15:47:19 -0400 Subject: [PATCH] LU-8066 libcfs: test for both __kernel_param_[un]lock and kernel_param_[un]lock In earlier kernels like RHEL6 no locking is available. Later the function __kernel_param_[un]lock() we introduced. In most recent kernels per module locking was introduced with the functions kernel_param_[un]lock() and __kernel_param_[un]lock() is no longer visible to modules. Since this is the case we need to make sure both HAVE_MODULE_PARAM_LOCKING and HAVE_KERNEL_PARAM_LOCK are not set in the case of RHEL6. Change-Id: I0957a16352c4fb49fb5d96c0ff4d331a8be9703a Signed-off-by: James Simmons Reviewed-on: https://review.whamcloud.com/28498 Tested-by: Jenkins Reviewed-by: Bob Glossman Tested-by: Maloo Reviewed-by: Olaf Weber Reviewed-by: John L. Hammond Reviewed-by: Oleg Drokin --- libcfs/libcfs/debug.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libcfs/libcfs/debug.c b/libcfs/libcfs/debug.c index f923842..02af6fa 100644 --- a/libcfs/libcfs/debug.c +++ b/libcfs/libcfs/debug.c @@ -68,7 +68,7 @@ static int libcfs_param_debug_mb_set(const char *val, * RHEL6 does not support any kind of locking so we have to provide * our own */ -#ifndef HAVE_MODULE_PARAM_LOCKING +#if !defined(HAVE_MODULE_PARAM_LOCKING) && !defined(HAVE_KERNEL_PARAM_LOCK) kernel_param_lock(THIS_MODULE); #endif if (!*((unsigned int *)kp->arg)) { @@ -81,7 +81,7 @@ static int libcfs_param_debug_mb_set(const char *val, if (!rc) *((unsigned int *)kp->arg) = cfs_trace_get_debug_mb(); -#ifndef HAVE_MODULE_PARAM_LOCKING +#if !defined(HAVE_MODULE_PARAM_LOCKING) && !defined(HAVE_KERNEL_PARAM_LOCK) kernel_param_unlock(THIS_MODULE); #endif return rc; -- 1.8.3.1