diff mbox series

[SRU,F,8/8] UBUNTU: SAUCE: Revert "modules: mark ref_module static"

Message ID 20210615220408.1407292-9-ian.may@canonical.com
State New
Headers show
Series UBUNTU: SAUCE: Revert upstream 'module' patches that removed exported symbols | expand

Commit Message

Ian May June 15, 2021, 10:04 p.m. UTC
BugLink: https://bugs.launchpad.net/bugs/1932065

This reverts commit adec698db991c715cf457782ce36ca1efb689b37.

Upstream introduced 'module' patches that removed exported symbols
that might cause potential disruption and breakage for customers.

Temporarily reverting as SAUCE patches to allow customers time to
make necessary changes to support patch changes.

Signed-off-by: Ian May <ian.may@canonical.com>
---
 include/linux/module.h | 1 +
 kernel/module.c        | 6 ++++--
 2 files changed, 5 insertions(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/include/linux/module.h b/include/linux/module.h
index 92b2058b2f03..6d20895e7739 100644
--- a/include/linux/module.h
+++ b/include/linux/module.h
@@ -636,6 +636,7 @@  static inline void __module_get(struct module *module)
 #define symbol_put_addr(p) do { } while (0)
 
 #endif /* CONFIG_MODULE_UNLOAD */
+int ref_module(struct module *a, struct module *b);
 
 /* This is a #define so the string doesn't get put in every .o file */
 #define module_name(mod)			\
diff --git a/kernel/module.c b/kernel/module.c
index eeb06b206e6b..c60559b5bf10 100644
--- a/kernel/module.c
+++ b/kernel/module.c
@@ -867,7 +867,7 @@  static int add_module_usage(struct module *a, struct module *b)
 }
 
 /* Module a uses b: caller needs module_mutex() */
-static int ref_module(struct module *a, struct module *b)
+int ref_module(struct module *a, struct module *b)
 {
 	int err;
 
@@ -886,6 +886,7 @@  static int ref_module(struct module *a, struct module *b)
 	}
 	return 0;
 }
+EXPORT_SYMBOL_GPL(ref_module);
 
 /* Clear the unload stuff of the module. */
 static void module_unload_free(struct module *mod)
@@ -1166,10 +1167,11 @@  static inline void module_unload_free(struct module *mod)
 {
 }
 
-static int ref_module(struct module *a, struct module *b)
+int ref_module(struct module *a, struct module *b)
 {
 	return strong_try_module_get(b);
 }
+EXPORT_SYMBOL_GPL(ref_module);
 
 static inline int module_unload_init(struct module *mod)
 {