X-Git-Url: http://pilppa.org/gitweb/gitweb.cgi?a=blobdiff_plain;ds=sidebyside;f=kernel%2Fmodule.c;h=e2d09d604ca08a7f7e73cd20eb972dcb02525115;hb=045f147f3290395661b56b9231fc4d221e150963;hp=45e01cb60101128c26737907c6c23d2a8acb58ab;hpb=e17e0f51aeea4e59c7e450a1c0f26605b91c1260;p=linux-2.6-omap-h63xx.git diff --git a/kernel/module.c b/kernel/module.c index 45e01cb6010..e2d09d604ca 100644 --- a/kernel/module.c +++ b/kernel/module.c @@ -34,10 +34,10 @@ #include #include #include +#include #include #include #include -#include #include #include #include @@ -790,6 +790,19 @@ static struct module_attribute refcnt = { .show = show_refcnt, }; +void module_put(struct module *module) +{ + if (module) { + unsigned int cpu = get_cpu(); + local_dec(&module->ref[cpu].count); + /* Maybe they're waiting for us to drop reference? */ + if (unlikely(!module_is_live(module))) + wake_up_process(module->waiter); + put_cpu(); + } +} +EXPORT_SYMBOL(module_put); + #else /* !CONFIG_MODULE_UNLOAD */ static void print_unload_info(struct seq_file *m, struct module *mod) {