[PATCH 04/14] header: add kernel_param_{lock,unlock}() functions

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



In the mainline kernel the kernel module parameter locking is not
protected by a global lock any more, but each module has its own lock
now. This resulted in some changes in the api. This patch converts
calls to the new api to the old one.

This backports the changes done in this commit:
commit b51d23e4e9fea6f264d39535c2a62d1f51e7ccc3
Author: Dan Streetman <ddstreet@xxxxxxxx>
Date:   Wed Jun 17 06:18:52 2015 +0930

    module: add per-module param_lock

Signed-off-by: Hauke Mehrtens <hauke@xxxxxxxxxx>
---
 backport/backport-include/linux/moduleparam.h | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/backport/backport-include/linux/moduleparam.h b/backport/backport-include/linux/moduleparam.h
index 517f50f..27003cd 100644
--- a/backport/backport-include/linux/moduleparam.h
+++ b/backport/backport-include/linux/moduleparam.h
@@ -9,4 +9,17 @@
 #define kparam_unblock_sysfs_write(a)
 #endif
 
+#if LINUX_VERSION_CODE < KERNEL_VERSION(4,2,0)
+#define kernel_param_lock LINUX_BACKPORT(kernel_param_lock)
+static inline void kernel_param_lock(struct module *mod)
+{
+	__kernel_param_lock();
+}
+#define kernel_param_unlock LINUX_BACKPORT(kernel_param_unlock)
+static inline void kernel_param_unlock(struct module *mod)
+{
+	__kernel_param_unlock();
+}
+#endif
+
 #endif /* __BACKPORT_LINUX_MODULEPARAM_H */
-- 
2.1.4

--
To unsubscribe from this list: send the line "unsubscribe backports" in



[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux