Subject: Re: generic hook infrastructure
To: None <tech-kern@netbsd.org>
From: Brett Lymn <blymn@baesystems.com.au>
List: tech-kern
Date: 02/02/2006 21:14:38
On Thu, Feb 02, 2006 at 04:26:52AM +0100, joerg@britannica.bec.de wrote:
>
> You mean an one-shot modus?
Yes, from vague memory the shutdown hooks operate like this.
>I'd say make the hook-removal O(1) with
> small O(1) and it can be implemented completely via a wrapper function.
>
Something like that would do the trick.
>
> Can you give an example of why this is needed? I can think of situations
> where you want to add a new hook at the end or the beginning of the
> current list, but no need to traverse the list backwards.
>
As Dan noted, mount hooks are run in the reverse order they are
registered, this makes a lot of sense if you have layered file systems
mounted.
--
Brett Lymn