]> git.hungrycats.org Git - linux/commit
[PATCH] module_put_and_exit
authorRusty Russell <rusty@rustcorp.com.au>
Fri, 18 Jul 2003 12:23:37 +0000 (05:23 -0700)
committerLinus Torvalds <torvalds@home.osdl.org>
Fri, 18 Jul 2003 12:23:37 +0000 (05:23 -0700)
commitf965803d21981208b5d483414e3c6b797363f37a
treef651e6e57087cc84748ebefc40b3e6edf72e6582
parentdc33faea52587f59b5b295d6db04e5e5699d272a
[PATCH] module_put_and_exit

Author: Neil Brown

Define module_put_and_exit() and use it for nfsd/lockd

Both nfsd and lockd have threads which expect to hold a reference
to the module while the thread is running.  In order for the thread
to be able to put_module() the module before exiting, the
put_module code must be call from outside the module.

This patch provides module_put_and_exit in non-modular code which a
thread-in-a-module can call.  It also gets nfsd and lockd to use it
as appropriate.

Note that in lockd, we can __get_module in the thread itself as the
creator of the thread is waiting for the thread to startup.

In nfsd and for the 'reclaimer' threaded started by locked, we
__get_module first and put_module if the thread failed to start.
fs/lockd/clntlock.c
fs/lockd/svc.c
fs/nfsd/nfssvc.c
include/linux/module.h
kernel/module.c