*BSD News Article 19792


Return to BSD News archive

Path: sserve!newshost.anu.edu.au!munnari.oz.au!news.Hawaii.Edu!ames!elroy.jpl.nasa.gov!usc!acsc.com!acsc.com!jerry
From: jerry@acsc.com (Jerry Chen)
Newsgroups: comp.os.386bsd.development
Subject: Re: a question about the mapsearch() in ufs
Date: 20 Aug 1993 22:10:26 GMT
Organization: Advanced Computing Systems Company
Lines: 17
Distribution: world
Message-ID: <253i4i$be6@acsc.com>
NNTP-Posting-Host: cpuserver.acsc.com

>>mapsearch() first scans from cg_blksfree(cgp)[n] to the end of
>>cg_blksfree(cgp)[] then from cg_blksfree(cgp)[0] to cg_blksfree(cgp)[n].
>>That is, cg_blksfree(cgp)[n] is scanned twice.  Why is this?  Or am I
>>miss-understanding the code?  Thanks in advance for the advice.
>
>It's not scanned twice -- it's scanned from the current rotational location
>to the end, then from the start of the cylinder to the current location.

Maybe I did not make my question clear.  What I do not understand is:

Why should we scan the current location twice?  

I thought it is enough to scan from the current block to the end of the 
cylinder group, then from the start of the cylinder group to the 
(current - 1) block.

Jerry