[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <alpine.LNX.2.01.1008231527390.21000@obet.zrqbmnf.qr>
Date: Mon, 23 Aug 2010 15:32:03 +0200 (CEST)
From: Jan Engelhardt <jengelh@...ozas.de>
To: Peter Zijlstra <peterz@...radead.org>
cc: Brian Gerst <brgerst@...il.com>, aijazbaig1@...il.com,
netfilter-devel@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: help needed with EXPORT_SYMBOL
On Monday 2010-08-23 15:17, Peter Zijlstra wrote:
>On Mon, 2010-08-23 at 07:48 -0400, Brian Gerst wrote:
>>
>> Use an exported function pointer in the main kernel as a hook that the
>> module sets when it is loaded. Note, you must use module_get and
>> module_put around the call to the module to prevent it from unloading
>> while in use.
>
>Please don't do any such thing, its impossible to use correctly.
>
>Suppose there are two modular users, A and B.
Though in case there is just a single user it can work out.
Just like bridge.c, and the bunch of nf_nat_*.c. :-)
Though yeah. Bad bad.
This is starting to sound pretty much like an XY problem: XY problem:
You want to do X, but don't know how. You think you can solve it using
Y, but don't know how to do that, either. You ask about Y, which is a
strange thing to want to do. Just ask about X.
(And then there is still the "good idea to do X in the first place"
thing.) Like what's so important to have as a module when you can build
it in, given that the caller is built-in (obj-y) itself.
>module_init()
>{
> old_fptr = fptr;
> fptr = A_func;
>}
>
>Then you load A, load B and unload A, then guess what happens?
>
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists