Subject: Re: Supporting sector size != DEV_BSIZE
To: Greywolf <greywolf@starwolf.com>
From: Bill Studenmund <wrstuden@netbsd.org>
List: tech-kern
Date: 06/05/2002 08:56:07
On Wed, 5 Jun 2002, Greywolf wrote:
> On Wed, 5 Jun 2002, Bill Studenmund wrote:
>
> # > I think you don't see what it's doing up there.
> # >
> # > fsbtodb converts filesystem _blocks_ to physical sectors, not frags.
> #
> # Yes, and at this level of the code, a file system block is a fragment.
> # i.e. on an 8k/1k ffs, dbtofsb() converts to the 1k things, not the 8k
> # things.
>
> What?!?
>
> You mean to tell me that fs_bsize is representative of the fragment size
> and not the block size...?
>
> That's confusing to read. Why isn't it using fs_fsize instead?
No, I'm not saying that fs_bsize is the fragment size.
I'm saying that fsbtodb converts from "fragments" to disk blocks.
Here's a portion of a dump of an 8k/1k ffs I have:
bsize 8192 shift 13 mask 0xffffe000
fsize 1024 shift 10 mask 0xfffffc00
frag 8 shift 3 fsbtodb 1
As you can see, fsbtodb only makes sense to convert between fragments (1k)
and disk blocks.
Also, don't forget that fragments, not "blocks" are the fundamental
allocation unit for ffs. :-)
Take care,
Bill