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 <uja.ornl@yahoo.com>
Reviewed-on: https://review.whamcloud.com/28498
Tested-by: Jenkins
Reviewed-by: Bob Glossman <bob.glossman@intel.com>
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Olaf Weber <olaf.weber@hpe.com>
Reviewed-by: John L. Hammond <john.hammond@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
* 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)) {
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;