Subject: Re: CVS commit: src/sys/kern
To: Thor Lancelot Simon <tls@netbsd.org>
From: Antti Kantee <pooka@netbsd.org>
List: tech-kern
Date: 10/22/2006 13:21:56
On Sun Oct 22 2006 at 04:16:02 +0000, Thor Lancelot Simon wrote:
> > Log Message:
> > pool_get(): use PR_WAITOK, not M_WAITOK (which happens to be PR_NOWAIT ..)
> > 
> > XXX: not the first time this mistake has been made
> 
> find /usr/src/sys -name *.[ch"]" -exec grep -l pool_.*M_ "{"} ";"
> ./dev/raidframe/rf_reconmap.c

        pool_prime(&p->elem_pool, RF_NUM_RECON_POOL_ELEM);

> ./kern/kern_kcont.c

        pool_flags = (malloc_flags & M_NOWAIT) ? 0 : PR_WAITOK;

These are not really problems, although I have to admit I missed the
latter one yesterday.

> There are probably more, in cases where a function argument is passed to
> pool_get() as the flag.
> 
> I think we should use different values for the constants and, if DIAGNOSTIC,
> assert that the constant is in fact in the correct range.

Something like that, yes.

-- 
Antti Kantee <pooka@iki.fi>                     Of course he runs NetBSD
http://www.iki.fi/pooka/                          http://www.NetBSD.org/
    "la qualité la plus indispensable du cuisinier est l'exactitude"