[lkml]   [2003]   [Jan]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: Kernel module version support.
In message <> you
> 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.

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
More majordomo info at
Please read the FAQ at

 \ /
  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