History

module: fix kdb's illicit use of struct module_use.

Linus changed the structure, and luckily this didn't compile any more.

Rusty Russell committed 16 years ago

Commit c8e21ce1 parent 2c02dfe3 files · +11 −19Browse files

Unified · Split

3 files
  1. include/linux/module.h +7 −0
  2. kernel/debug/kdb/kdb_main.c +3 −9
  3. kernel/module.c +1 −10
include/linux/module.h+7−0
@@ -181,6 +181,13 @@ void *__symbol_get(const char *symbol); · 180 unmodified lines
181181 void *__symbol_get_gpl(const char *symbol);
182182 #define symbol_get(x) ((typeof(&x))(__symbol_get(MODULE_SYMBOL_PREFIX #x)))
183183
184+/* modules using other modules: kdb wants to see this. */
185+struct module_use {
186+ struct list_head source_list;
187+ struct list_head target_list;
188+ struct module *source, *target;
189+};
190+
184191 #ifndef __GENKSYMS__
185192 #ifdef CONFIG_MODVERSIONS
186193 /* Mark the CRC weak since genksyms apparently decides not to
kernel/debug/kdb/kdb_main.c+3−9
@@ -1857,12 +1857,6 @@ static int kdb_ef(int argc, const char **argv) · 1856 unmodified lines
18571857 }
18581858
18591859 #if defined(CONFIG_MODULES)
1860−/* modules using other modules */
1861−struct module_use {
1862− struct list_head list;
1863− struct module *module_which_uses;
1864−};
1865−
18661860 /*
18671861 * kdb_lsmod - This function implements the 'lsmod' command. Lists
18681862 * currently loaded kernel modules.
@@ -1894,9 +1888,9 @@ static int kdb_lsmod(int argc, const char **argv) · 25 unmodified lines
18941888 {
18951889 struct module_use *use;
18961890 kdb_printf(" [ ");
1897− list_for_each_entry(use, &mod->modules_which_use_me,
1898− list)
1899− kdb_printf("%s ", use->module_which_uses->name);
1891+ list_for_each_entry(use, &mod->source_list,
1892+ source_list)
1893+ kdb_printf("%s ", use->target->name);
19001894 kdb_printf("]\n");
19011895 }
19021896 #endif
kernel/module.c+1−10
@@ -536,14 +536,6 @@ static void module_unload_init(struct module *mod) · 535 unmodified lines
536536 mod->waiter = current;
537537 }
538538
539−/* modules using other modules */
540−struct module_use
541−{
542− struct list_head source_list;
543− struct list_head target_list;
544− struct module *source, *target;
545−};
546−
547539 /* Does a already use b? */
548540 static int already_uses(struct module *a, struct module *b)
549541 {
@@ -589,8 +581,7 @@ static int add_module_usage(struct module *a, struct module *b) · 39 unmodified lines
589581 /* Module a uses b */
590582 int use_module(struct module *a, struct module *b)
591583 {
592− struct module_use *use;
593− int no_warn, err;
584+ int err;
594585
595586 if (b == NULL || already_uses(a, b)) return 1;
596587