summaryrefslogtreecommitdiffstats
path: root/kernel
diff options
context:
space:
mode:
authorPeter Oberparleiter <peter.oberparleiter@de.ibm.com>2008-04-21 14:34:31 +0200
committerRusty Russell <rusty@rustcorp.com.au>2008-05-01 21:15:01 +1000
commitdf4b565e1fbc777bb6e274378a41fa8ff7485680 (patch)
tree8b64f22bb57419d57fdd4914645bafeaf9171733 /kernel
parentb211104d111c99dbb97c636b57bd9db711455684 (diff)
downloadop-kernel-dev-df4b565e1fbc777bb6e274378a41fa8ff7485680.zip
op-kernel-dev-df4b565e1fbc777bb6e274378a41fa8ff7485680.tar.gz
module: add MODULE_STATE_GOING notifier call
Provide module unload callback. Required by the gcov profiling infrastructure to keep track of profiling data structures. Signed-off-by: Peter Oberparleiter <peter.oberparleiter@de.ibm.com> Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Diffstat (limited to 'kernel')
-rw-r--r--kernel/module.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/kernel/module.c b/kernel/module.c
index d2d093e..8674a39 100644
--- a/kernel/module.c
+++ b/kernel/module.c
@@ -745,12 +745,13 @@ sys_delete_module(const char __user *name_user, unsigned int flags)
if (!forced && module_refcount(mod) != 0)
wait_for_zero_refcount(mod);
+ mutex_unlock(&module_mutex);
/* Final destruction now noone is using it. */
- if (mod->exit != NULL) {
- mutex_unlock(&module_mutex);
+ if (mod->exit != NULL)
mod->exit();
- mutex_lock(&module_mutex);
- }
+ blocking_notifier_call_chain(&module_notify_list,
+ MODULE_STATE_GOING, mod);
+ mutex_lock(&module_mutex);
/* Store the name of the last unloaded module for diagnostic purposes */
strlcpy(last_unloaded_module, mod->name, sizeof(last_unloaded_module));
free_module(mod);
@@ -2191,6 +2192,8 @@ sys_init_module(void __user *umod,
mod->state = MODULE_STATE_GOING;
synchronize_sched();
module_put(mod);
+ blocking_notifier_call_chain(&module_notify_list,
+ MODULE_STATE_GOING, mod);
mutex_lock(&module_mutex);
free_module(mod);
mutex_unlock(&module_mutex);
OpenPOWER on IntegriCloud