Subject: Re: Another question about LFS data
To: Trevin Beattie <trevin@xmission.com>
From: Konrad Schroder <perseant@hhhh.org>
List: tech-kern
Date: 06/20/2002 17:56:15
On Thu, 20 Jun 2002, Trevin Beattie wrote:

> Was I correct in thinking that b_lblkno is the same as b_blkno?  In
> lfs_newclusterbuf() they are both set to the addr parameter, but I found a
> line in lfs_updatemeta() that appears to print a warning if they are both
> the same.

Well, no, they're not the same.  b_lblkno is the logical address, i.e.,
where in the file this is.  b_blkno is the physical address, i.e., where
on the disk this is.  They're given the same number for new blocks created
in the cache, for historical reasons (I think that for block and character
devices, b_blkno and b_lblkno are equivalent).  For your purposes you
probably don't care at all about b_lblkno.

The warning is there because in the 4.4BSD LFS there was some code that
assumed that if b_blkno and b_lblkno were the same, the block had not yet
been assigned a real b_blkno; with a comment to the effect that "they're
almost never really the same, but if they ever were we would miscount".
"Almost never" turned out to mean "once every few days".  We don't have
that assumption anymore but the warning remains.

						Konrad Schroder
						perseant@hhhh.org