From: Ian May Date: Tue, 15 Jun 2021 22:04:00 +0000 (+0200) Subject: UBUNTU: SAUCE: Revert "modules: mark ref_module static" X-Git-Tag: Ubuntu-5.4.0-78.87~444 X-Git-Url: https://git.proxmox.com/?a=commitdiff_plain;h=913f6eb422d60e5695bb91273e45b8dca91db5b3;p=mirror_ubuntu-focal-kernel.git UBUNTU: SAUCE: Revert "modules: mark ref_module static" 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 Acked-by: Kamal Mostafa Acked-by: Khaled Elmously Signed-off-by: Stefan Bader --- 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) {