diff mbox series

[21/75] backports: add module namespace support

Message ID 20240627234808.1253337-22-hauke@hauke-m.de (mailing list archive)
State New, archived
Headers show
Series backports: Update to kernel 6.1.95 | expand

Commit Message

Hauke Mehrtens June 27, 2024, 11:47 p.m. UTC
From: Johannes Berg <johannes.berg@intel.com>

Add EXPORT_SYMBOL_NS_GPL() and MODULE_IMPORT_NS(),
for kernels that don't yet know about it. Just do
nothing about namespaces in that case, of course.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
---
 backport/backport-include/linux/export.h | 12 ++++++++++++
 backport/backport-include/linux/module.h |  4 ++++
 2 files changed, 16 insertions(+)
 create mode 100644 backport/backport-include/linux/export.h
diff mbox series

Patch

diff --git a/backport/backport-include/linux/export.h b/backport/backport-include/linux/export.h
new file mode 100644
index 00000000..c24c9f99
--- /dev/null
+++ b/backport/backport-include/linux/export.h
@@ -0,0 +1,12 @@ 
+#ifndef _COMPAT_LINUX_EXPORT_H
+#define _COMPAT_LINUX_EXPORT_H 1
+
+#include <linux/version.h>
+
+#include_next <linux/export.h>
+
+#ifndef EXPORT_SYMBOL_NS_GPL
+#define EXPORT_SYMBOL_NS_GPL(sym, ns) EXPORT_SYMBOL_GPL(sym)
+#endif
+
+#endif /* _COMPAT_LINUX_EXPORT_H */
diff --git a/backport/backport-include/linux/module.h b/backport/backport-include/linux/module.h
index efe970f1..b93a56d9 100644
--- a/backport/backport-include/linux/module.h
+++ b/backport/backport-include/linux/module.h
@@ -67,4 +67,8 @@  extern void backport_dependency_symbol(void);
 	__CFI_ADDRESSABLE(cleanup_module, __exitdata);
 #endif
 
+#if LINUX_VERSION_IS_LESS(5,4,0)
+#define MODULE_IMPORT_NS(ns)
+#endif
+
 #endif /* __BACKPORT_LINUX_MODULE_H */