Subject: Re: Supporting sector size != DEV_BSIZE -- patches
To: Chuck Silvers <chuq@chuq.com>
From: Trevin Beattie <trevin@xmission.com>
List: tech-kern
Date: 06/04/2002 12:54:07
At 08:16 PM 6/3/2002 -0700, Chuck Silvers wrote:
>currently every disk driver and almost all of the rest of the system
>assume b_blkno is in units of DEV_BSIZE, so it would definitely be easier
>to fix the few places that assume something else than to switch everything
>that assumes units of DEV_BSIZE.
>
>as for FFS, I think the only place it has a problem is in its usage of
>the fs_fsbtodb field in the superblock.  code that uses this field is
>attempting to convert from a fragment size to the units of b_blkno,
>so such code should really just compute the desired value
>	(fs->fs_fshift - DEV_BSHIFT)
>rather than using the value in the superblock.

As I understand it then, your suggestion is to replace every instance of
fs->fsbtodb, fsbtodb(), and dbtofsb() with the above equation.  That would
certainly be much clearer than the way it is now (since the very definition
of "db" is still unsettled).

After fixing the kernel, what would we do with the unused fsbtodb and
dbtofsb macros?  Define them in terms of sectors?  Deprecate them?  Replace
them with something that issues a compiler error?  It seems to me that
fs_fsbtodb should at least be deprecated, since its intended purpose can
more reliably be derived from fs_fshift.

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