Re: owner field in `struct fs'

From: Keith Owens (kaos@ocs.com.au)
Date: Mon Jun 26 2000 - 20:14:47 EST


On Mon, 26 Jun 2000 13:48:14 -0400 (EDT),
Alexander Viro <viro@math.psu.edu> wrote:
>Erm... There is one case when MOD_INC_USE_COUNT is kosher and even needed,
>but it's pretty convoluted. Consider modules A, B and C.
> A provides register_foo() and unregister_foo()
> B provides foo1
> C does register_foo(&foo1) and unregister_foo(&foo1) for ioctls on
>some device.
>
>Notice that C depends on A and B, but A and B are independent. However,
>once foo1 is registered we want A to be pinned down. MOD_INC_USE_COUNT in
>register_foo() is OK here - C depends on A and if we have C around the A
>will stay there...

No need. A does EXPORT_SYMBOL(register_foo), C has an unresolved
symbol reference to register_foo. sys_init_module() sets mod->refs on
A pointing to C, sys_delete_module() will not unload A as long as C is
loaded.

AFAICT, pinning modules by symbol reference is race safe, all the work
is done in module.c under BKL.

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Mon Jun 26 2000 - 21:00:10 EST