Subject: Re: unintended consequences of ffs_dirpref()?
To: Bill Sommerfeld <sommerfeld@netbsd.org>
From: Matt Thomas <matt@3am-software.com>
List: tech-kern
Date: 01/16/2001 11:58:59
At 02:46 PM 1/16/2001 -0500, Bill Sommerfeld wrote:
> >  > Thoughts?
> >
> > Yes.  How about doing the loop twice -- if you don't find anything
> > the first time, then do it again without checking cs_nbfree.
>
>How about, instead:
>
>         - scan once looking for cs_nbfree > 0; return best found if any
>         - scan once looking for cs_nffree > 0; return best found if any
>         - return 0; mkdir will fail because the disk is full.

How scanning once but keep track of "best" nbfree/nffree?
Once the loop exits, pick the right cylinder or return 0.
--
Matt Thomas               Internet:   matt@3am-software.com
3am Software Foundry      WWW URL:    http://www.3am-software.com/bio/matt/
Cupertino, CA             Disclaimer: I avow all knowledge of this message