Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 26 Mar 2004 07:44:58 +0100
From:      Toni Andjelkovic <toni@soth.at>
To:        Sam Lawrance <samuel.lawrance@studentmail.newcastle.edu.au>
Cc:        freebsd-hackers@freebsd.org
Subject:   Re: kldstat and module ref count
Message-ID:  <20040326064458.GK1227@tv.soth.at>
In-Reply-To: <1080252926.1138.18.camel@dirk>
References:  <1080252926.1138.18.camel@dirk>

next in thread | previous in thread | raw e-mail | index | archive | help
On Fri, Mar 26 2004 (09:15:26 +1100), Sam Lawrance wrote:
> I've tried to find the answer to this but am stuck. How can I prevent a
> kld module being unloaded if it is still in use?
> 
> Filesystem modules give "device busy" if you try to kldunload them while
> still in use. Any sort of quick pointer in the right direction would be
> much appreciated.

You may veto the unload by returning an error > 0 from the module event
handler. See md_modevent() in sys/dev/md/md.c or vfs_modevent() in
sys/kern/vfs_init.c for examples.

Cheers,
Toni



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20040326064458.GK1227>