Ext2 vs UFS getlbns

Brian Bergstrand brian at classicalguitar.net
Fri Jun 11 19:33:37 GMT 2004


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

I just noticed something in ext2_getlbns() (ext2_bmap.c, v1.57) vs. 
ufs_getlbns() (ufs_bmap.c, v1.60)

In the last loop to setup the indir array,

UFS does:

{
...
blockcnt /= MNINDIR(ump);
off = (bn / blockcnt) % MNINDIR(ump);

++numlevels;
ap->in_lbn = metalbn;
ap->in_off = off;
ap->in_exists = 0;
++ap;

metalbn -= -1 + off * blockcnt;
}

While Ext2 does:

{
...
off = (bn / blockcnt) % MNINDIR(ump);

++numlevels;
ap->in_lbn = metalbn;
ap->in_off = off;
ap->in_exists = 0;
++ap;

metalbn -= -1 + off * blockcnt;
blockcnt /= MNINDIR(ump);
}

Notice that blockcnt is calculated AFTER the offset in Ext2 and BEFORE 
the offset in UFS.

Was this change in Ext2 done on purpose for some reason, or does it not 
make a difference? I would think with some block  block #'s it would.

Thanks.

Brian Bergstrand <http://www.bergstrand.org/brian/>, AIM: triryche206
PGP Key: <http://www.bergstrand.org/brian/misc/public_key.txt>
Hell, there are no rules here--we're trying to accomplish something. - 
Thomas A. Edison
As of 07:50:41 PM, iTunes is playing "Bouncing Around The Room" from 
"Lawn Boy" by "Phish"

-----BEGIN PGP SIGNATURE-----
Version: PGP 8.0.3

iQA/AwUBQMj5L3nR2Fu2x7aiEQJJPACePBqrrfWVXW+VJjx5ucfo+WPJ7+oAoODa
v40zOqo1FAmMVcgL2NSAoMsL
=jtnG
-----END PGP SIGNATURE-----



More information about the freebsd-fs mailing list