Subject: Re: Supporting sector size != DEV_BSIZE on lfs
To: Konrad Schroder <perseant@hhhh.org>
From: Trevin Beattie <trevin@xmission.com>
List: tech-kern
Date: 06/20/2002 11:38:25
At 11:02 AM 6/20/2002 -0700, Konrad Schroder wrote:
>On Thu, 20 Jun 2002, Trevin Beattie wrote:
>> ffshift).  IMO, the affix 'db' should be eliminated entirely from struct
>> dlfs in favor of one that denotes sector size.
>
>But see my comment above, it is intended to mean logical sector size.

But there is no 'd' or 'b' in "logical sector size".  Is confusing.  :^)

>> more.  (Four of the existing macros use three terms; the fix for lfs_ifind
>> (lfs_inode.c:138) requires four.)
>
>What is the "fix" for lfs_inode.c:138 ?

The printf statement is supposed to convert a kernel b_blkno (unit
DEV_BSIZE) to an LFS fsb number.  But instead it's using the conversion for
sectors -> fsb.  Using existing variables, the shortest equation I can come
up with for the proper conversion is:

	lfs_bshift - lfs->blktodb - DEV_BSHIFT + lfs_fsbtodb

which is equivalent to

	bytes    blocks    DEV_BSIZEs   sectors
	------ * ------- * ---------- * -------
	blocks   sectors     bytes       fsb's

-----------------------
Trevin Beattie          "Do not meddle in the affairs of wizards,
trevin@xmission.com     for you are crunchy and good with ketchup."
      {:->                                     --unknown