lkml.org 
[lkml]   [2003]   [Jan]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: Kernel module version support.
Date
In message <957BD1C2BF3CD411B6C500A0C944CA2601F1170F@pdsmsx32.pd.intel.com> you
write:
> Hi Rusty
> Thanks for your rapid responding.
>
> And as you are the maintainer of kernel module support, I would like to know
> how
> you think about export some APIs for geting a specified module structure's
> pointer.
> Just like:
> struct module *get_module(const char *name)
> {
> struct module *mod;
> down(&module_mutex);
> mod = find_module(name);
> up(&module_mutex);
> return mod;
> }
> EXPORT_SYMBOL_GPL(get_module);

Well, you also need:
if (mod && !try_module_get(mod))
mod = NULL; /* Not ready, or vanishing. Ignore. */

Just before the "up(&module_mutex);".

I'm not convinced you don't want some other, more powerful interface,
though, like "get_ksymbol_address()" or something.

Rusty.
--
Anyone who quotes me in their sig is an idiot. -- Rusty Russell.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:32    [W:0.024 / U:0.216 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site