Re: [PATCH] remove useless MOD_{INC,DEC}_USE_COUNT from sunrpc

From: Christoph Hellwig (hch@lst.de)
Date: Mon May 05 2003 - 03:29:41 EST


On Sun, May 04, 2003 at 01:15:58PM -0700, David S. Miller wrote:
> From: Christoph Hellwig <hch@lst.de>
> Date: Sun, 4 May 2003 23:00:11 +0200
>
> Oh well, what about something like the following?
> ...
> + */
> + if (!try_module_get(THIS_MODULE))
> + return -EBUSY;
>
> Ahem... Why don't we just do this right? :-)
>
> By this I mean provide some real registry thing in the
> main kernel image that we can use to do try_module_get()
> outside of the sunrpc module?

Please read the comment above that piece of code. We always
enter this through an exported function so we know we currently
aren't unloadable.

> The other option is the make more progress in the area of
> two-stage module unload, and allowing cleanup() to return
> whether the module is unloadable or not. This is being
> discussed on netdev so that we have some way to make ipv6
> modules work sanely (instead of putting try_module_get() in
> every other line, that simply isn't acceptable).

That's fine with me, but I won't sign up to do that work :)

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



This archive was generated by hypermail 2b29 : Wed May 07 2003 - 22:00:21 EST