summaryrefslogtreecommitdiff
path: root/kernel/module/internal.h
diff options
context:
space:
mode:
authorAaron Tomlin <atomlin@redhat.com>2022-03-22 14:03:42 +0000
committerLuis Chamberlain <mcgrof@kernel.org>2022-04-05 08:43:04 -0700
commit44c09535de4784f31d151aa1047efcf4797ca3cd (patch)
treed1e60861ed1ec1cfdc67ca4f3d342454b40c4924 /kernel/module/internal.h
parent0ffc40f6c8ab684e694774ebc835b198398129a8 (diff)
module: Move sysfs support into a separate file
No functional change. This patch migrates module sysfs support out of core code into kernel/module/sysfs.c. In addition simple code refactoring to make this possible. Reviewed-by: Christophe Leroy <christophe.leroy@csgroup.eu> Signed-off-by: Aaron Tomlin <atomlin@redhat.com> Signed-off-by: Luis Chamberlain <mcgrof@kernel.org>
Diffstat (limited to 'kernel/module/internal.h')
-rw-r--r--kernel/module/internal.h21
1 files changed, 21 insertions, 0 deletions
diff --git a/kernel/module/internal.h b/kernel/module/internal.h
index 6af40c2d145f..62d749ef695e 100644
--- a/kernel/module/internal.h
+++ b/kernel/module/internal.h
@@ -34,6 +34,9 @@
extern struct mutex module_mutex;
extern struct list_head modules;
+extern struct module_attribute *modinfo_attrs[];
+extern size_t modinfo_attrs_count;
+
/* Provided by the linker */
extern const struct kernel_symbol __start___ksymtab[];
extern const struct kernel_symbol __stop___ksymtab[];
@@ -204,3 +207,21 @@ static inline void init_build_id(struct module *mod, const struct load_info *inf
static inline void layout_symtab(struct module *mod, struct load_info *info) { }
static inline void add_kallsyms(struct module *mod, const struct load_info *info) { }
#endif /* CONFIG_KALLSYMS */
+
+#ifdef CONFIG_SYSFS
+int mod_sysfs_setup(struct module *mod, const struct load_info *info,
+ struct kernel_param *kparam, unsigned int num_params);
+void mod_sysfs_teardown(struct module *mod);
+void init_param_lock(struct module *mod);
+#else /* !CONFIG_SYSFS */
+static inline int mod_sysfs_setup(struct module *mod,
+ const struct load_info *info,
+ struct kernel_param *kparam,
+ unsigned int num_params)
+{
+ return 0;
+}
+
+static inline void mod_sysfs_teardown(struct module *mod) { }
+static inline void init_param_lock(struct module *mod) { }
+#endif /* CONFIG_SYSFS */