Re: RFC: modules and 2.5

Rusty Russell
2001-07-06T23:10:52Z

In message <3B415489.77425364@mandrakesoft.com> you write:
> A couple things that would be nice for 2.5 is
> - let MOD_INC_USE_COUNT work even when module is built into kernel, and
> - let THIS_MODULE exist and be valid even when module is built into
> kernel

Hi Jeff,

What use are module use counts, if not used to prevent unloading?

> The reasoning behind this is that module use counts are useful sometimes
> even when the driver is built into the kernel. Other facilities like
> inter_xxx are [obviously] useful when built into the kernel, so it makes

Let's be clear: inter_module_xxx is Broken as Designed. It's a
terrible interface that has the added merit of being badly
implemented.

If you have a module B which has a soft dependency ("must use if
there") on module A, inter_xxx doesn't help without opening a can of
worms (if module B inserted after module A, oops).

The best ways out of this are:
1) Create two versions of module B: an A+B one, and a B-alone one.
2) Place infrastructure in the core kernel.
(This is what I did for ipt_REJECT needing to know about NAT).

Also, I far prefer the simplicity of get_symbol and put_symbol.

Cheers,
Rusty.
--
Premature optmztion is rt of all evl. --DK