Subject: Re: Supporting sector size != DEV_BSIZE on lfs
To: Trevin Beattie <trevin@xmission.com>
From: Konrad Schroder <perseant@hhhh.org>
List: tech-kern
Date: 06/19/2002 17:55:35
On Wed, 19 Jun 2002, Trevin Beattie wrote:

> So you're saying that in v1, lfs_fsbtodb is zero; while in v2, lfs_fsbtodb
> == lfs_blktodb - lfs_fbshift.  So the whole purpose of fragstofsb() is to
> cancel out the effect of (lfs_blktodb - lfs_fbshift)?  Can I put that in a
> code comment?

Sure, though if it's really converting between frags and fsb, I'm not sure
what the point of commenting that is?

How about this above the XtoY macros in lfs.h:

/*
 * The following macros convert between various different sized units:
 *
 * b:     bytes.
 * db:    logical disk sectors, currently equal to DEV_BSIZE which is also
 *        equal to the disklabel sector size.
 * fsb:   the unit of block addressing; equal to fragments in v2, but equal
 *        to db in v1.  All on-disk data structures pertaining to block
 *        addresses are in fsb.
 * frags: filesystem fragments (lfs_fsize).
 * blk:   filesystem blocks (lfs_bsize).
 * seg:   filesystem segments.
 */

?  Some of the macros (e.g., "segtod" and "numfrags") don't follow the
conventions, but those can be changed to suit.

						Konrad Schroder
						perseant@hhhh.org