Re: [RFC] add kobject to struct module

Rusty Russell
2004-03-05T14:36:56Z

[-- Attachment #1: Type: text/plain, Size: 1013 bytes --]

On Wed, 2004-02-25 at 10:29, Greg KH wrote:
> So, here's a patch on top of your patch (full patch against 2.6.3 is
> below), that simply makes the module reference file be owned by the
> module that it is assigned to. Yes, this means that when you actually
> read the file value, the reference is 1 greater than when it is closed,
> but that's the breaks. It does solve the "grab the file and then try to
> unload the module" problem, as it simply prevents this from happening.
>
> Comments?

I've rewritten your rewrite again 8)

This patch actually implements module_param in sysfs for modules. You
can see my tests in crypto_null().

What's missing is inbuilt modules. I think /sys/modules/ne2k/debug
should exist whether ne2k is built-in or modular, for example. Since
the only thing we have is a kparam with "ne2k.debug" as its name, there
will have to be some kludgery here, but we can end up with something OK.

Cheers,
Rusty.
--
Anyone who quotes me in their signature is an idiot -- Rusty Russell

[-- Attachment #2: module_kobject.patch.gz --]
[-- Type: application/x-gzip, Size: 3310 bytes --]