diff options
-rw-r--r-- | kernel/module.c | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/kernel/module.c b/kernel/module.c index dcb8a2cbf75e..5bbf225ca07a 100644 --- a/kernel/module.c +++ b/kernel/module.c | |||
@@ -2357,21 +2357,30 @@ static void m_stop(struct seq_file *m, void *p) | |||
2357 | mutex_unlock(&module_mutex); | 2357 | mutex_unlock(&module_mutex); |
2358 | } | 2358 | } |
2359 | 2359 | ||
2360 | static char *taint_flags(unsigned int taints, char *buf) | 2360 | static char *module_flags(struct module *mod, char *buf) |
2361 | { | 2361 | { |
2362 | int bx = 0; | 2362 | int bx = 0; |
2363 | 2363 | ||
2364 | if (taints) { | 2364 | if (mod->taints || |
2365 | mod->state == MODULE_STATE_GOING || | ||
2366 | mod->state == MODULE_STATE_COMING) { | ||
2365 | buf[bx++] = '('; | 2367 | buf[bx++] = '('; |
2366 | if (taints & TAINT_PROPRIETARY_MODULE) | 2368 | if (mod->taints & TAINT_PROPRIETARY_MODULE) |
2367 | buf[bx++] = 'P'; | 2369 | buf[bx++] = 'P'; |
2368 | if (taints & TAINT_FORCED_MODULE) | 2370 | if (mod->taints & TAINT_FORCED_MODULE) |
2369 | buf[bx++] = 'F'; | 2371 | buf[bx++] = 'F'; |
2370 | /* | 2372 | /* |
2371 | * TAINT_FORCED_RMMOD: could be added. | 2373 | * TAINT_FORCED_RMMOD: could be added. |
2372 | * TAINT_UNSAFE_SMP, TAINT_MACHINE_CHECK, TAINT_BAD_PAGE don't | 2374 | * TAINT_UNSAFE_SMP, TAINT_MACHINE_CHECK, TAINT_BAD_PAGE don't |
2373 | * apply to modules. | 2375 | * apply to modules. |
2374 | */ | 2376 | */ |
2377 | |||
2378 | /* Show a - for module-is-being-unloaded */ | ||
2379 | if (mod->state == MODULE_STATE_GOING) | ||
2380 | buf[bx++] = '-'; | ||
2381 | /* Show a + for module-is-being-loaded */ | ||
2382 | if (mod->state == MODULE_STATE_COMING) | ||
2383 | buf[bx++] = '+'; | ||
2375 | buf[bx++] = ')'; | 2384 | buf[bx++] = ')'; |
2376 | } | 2385 | } |
2377 | buf[bx] = '\0'; | 2386 | buf[bx] = '\0'; |
@@ -2398,7 +2407,7 @@ static int m_show(struct seq_file *m, void *p) | |||
2398 | 2407 | ||
2399 | /* Taints info */ | 2408 | /* Taints info */ |
2400 | if (mod->taints) | 2409 | if (mod->taints) |
2401 | seq_printf(m, " %s", taint_flags(mod->taints, buf)); | 2410 | seq_printf(m, " %s", module_flags(mod, buf)); |
2402 | 2411 | ||
2403 | seq_printf(m, "\n"); | 2412 | seq_printf(m, "\n"); |
2404 | return 0; | 2413 | return 0; |
@@ -2493,7 +2502,7 @@ void print_modules(void) | |||
2493 | 2502 | ||
2494 | printk("Modules linked in:"); | 2503 | printk("Modules linked in:"); |
2495 | list_for_each_entry(mod, &modules, list) | 2504 | list_for_each_entry(mod, &modules, list) |
2496 | printk(" %s%s", mod->name, taint_flags(mod->taints, buf)); | 2505 | printk(" %s%s", mod->name, module_flags(mod, buf)); |
2497 | printk("\n"); | 2506 | printk("\n"); |
2498 | } | 2507 | } |
2499 | 2508 | ||