Subject: Re: Supporting sector size != DEV_BSIZE
To: Trevin Beattie <trevin@xmission.com>
From: Chuck Silvers <chuq@chuq.com>
List: tech-kern
Date: 06/04/2002 22:26:38
oops, I even wrote that one.  we should convert bp->b_blkno from
DEV_BSIZE-units to fragments before using it in the rest of the
computation.  I've checked in the fix and requested it be included in 1.6.

thanks!

-Chuck


On Tue, Jun 04, 2002 at 03:35:09PM -0700, Trevin Beattie wrote:
> Totally confusing:
> 
> sys/ufs/ffs/ffs_balloc.c:441 reads:
> 	nb = fsbtodb(fs, cgtod(fs, dtog(fs, bp->b_blkno)));
> nb is a logical (DEV_BSIZE) block number to be passed to getblk().
> fsbtodb converts a frag number to a logical block number.
> cgtod returns the frag number of a cylinder group block.
> dtog converts a frag number to a cylinder group number.
> b_blkno is a logical block number.
> 
> WHY is b_blkno passed directly to dtog()??  Does this section of code
> actually work as written?  (It's in the 'fail'/unwind section of
> ffs_balloc().)  Am I mistaken in understanding what the macros do?  (After
> all, I only know what I read in the code comments.)
> 
> -----------------------
> Trevin Beattie          "Do not meddle in the affairs of wizards,
> trevin@xmission.com     for you are crunchy and good with ketchup."
>       {:->                                     --unknown