aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2010-06-05 00:09:48 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2010-06-05 00:09:48 -0400
commit90ec7819737d42a0ad1c2df1ff56016facae3c6e (patch)
tree0dac92b38de5cb13764b5f3de33346359928deda /include/linux
parent8ce655e737dc395e115ecdce143a43b9b6127f46 (diff)
parent9bea7f23952d5948f8e5dfdff4de09bb9981fb5f (diff)
Merge git://git.kernel.org/pub/scm/linux/kernel/git/rusty/linux-2.6-for-linus
* git://git.kernel.org/pub/scm/linux/kernel/git/rusty/linux-2.6-for-linus: module: fix bne2 "gave up waiting for init of module libcrc32c" module: verify_export_symbols under the lock module: move find_module check to end module: make locking more fine-grained. module: Make module sysfs functions private. module: move sysfs exposure to end of load_module module: fix kdb's illicit use of struct module_use. module: Make the 'usage' lists be two-way
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/module.h44
1 files changed, 10 insertions, 34 deletions
diff --git a/include/linux/module.h b/include/linux/module.h
index 6914fcad4673..8a6b9fdc7ffa 100644
--- a/include/linux/module.h
+++ b/include/linux/module.h
@@ -181,6 +181,13 @@ void *__symbol_get(const char *symbol);
181void *__symbol_get_gpl(const char *symbol); 181void *__symbol_get_gpl(const char *symbol);
182#define symbol_get(x) ((typeof(&x))(__symbol_get(MODULE_SYMBOL_PREFIX #x))) 182#define symbol_get(x) ((typeof(&x))(__symbol_get(MODULE_SYMBOL_PREFIX #x)))
183 183
184/* modules using other modules: kdb wants to see this. */
185struct module_use {
186 struct list_head source_list;
187 struct list_head target_list;
188 struct module *source, *target;
189};
190
184#ifndef __GENKSYMS__ 191#ifndef __GENKSYMS__
185#ifdef CONFIG_MODVERSIONS 192#ifdef CONFIG_MODVERSIONS
186/* Mark the CRC weak since genksyms apparently decides not to 193/* Mark the CRC weak since genksyms apparently decides not to
@@ -359,7 +366,9 @@ struct module
359 366
360#ifdef CONFIG_MODULE_UNLOAD 367#ifdef CONFIG_MODULE_UNLOAD
361 /* What modules depend on me? */ 368 /* What modules depend on me? */
362 struct list_head modules_which_use_me; 369 struct list_head source_list;
370 /* What modules do I depend on? */
371 struct list_head target_list;
363 372
364 /* Who is waiting for us to be unloaded */ 373 /* Who is waiting for us to be unloaded */
365 struct task_struct *waiter; 374 struct task_struct *waiter;
@@ -663,43 +672,10 @@ static inline int module_get_iter_tracepoints(struct tracepoint_iter *iter)
663 672
664#endif /* CONFIG_MODULES */ 673#endif /* CONFIG_MODULES */
665 674
666struct device_driver;
667#ifdef CONFIG_SYSFS 675#ifdef CONFIG_SYSFS
668struct module;
669
670extern struct kset *module_kset; 676extern struct kset *module_kset;
671extern struct kobj_type module_ktype; 677extern struct kobj_type module_ktype;
672extern int module_sysfs_initialized; 678extern int module_sysfs_initialized;
673
674int mod_sysfs_init(struct module *mod);
675int mod_sysfs_setup(struct module *mod,
676 struct kernel_param *kparam,
677 unsigned int num_params);
678int module_add_modinfo_attrs(struct module *mod);
679void module_remove_modinfo_attrs(struct module *mod);
680
681#else /* !CONFIG_SYSFS */
682
683static inline int mod_sysfs_init(struct module *mod)
684{
685 return 0;
686}
687
688static inline int mod_sysfs_setup(struct module *mod,
689 struct kernel_param *kparam,
690 unsigned int num_params)
691{
692 return 0;
693}
694
695static inline int module_add_modinfo_attrs(struct module *mod)
696{
697 return 0;
698}
699
700static inline void module_remove_modinfo_attrs(struct module *mod)
701{ }
702
703#endif /* CONFIG_SYSFS */ 679#endif /* CONFIG_SYSFS */
704 680
705#define symbol_request(x) try_then_request_module(symbol_get(x), "symbol:" #x) 681#define symbol_request(x) try_then_request_module(symbol_get(x), "symbol:" #x)