Ext2 vs UFS getlbns

Brian Bergstrand brian at classicalguitar.net
Fri Jun 11 16:32:26 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 changed AFTER offset/metalbn in Ext2 and BEFORE 
those in UFS.

Was this change in Ext2 done on purpose for some reason? It makes a 
difference in calculating in_off and metalbn for some block #'s.

Thanks.

Brian Bergstrand <http://www.bergstrand.org/brian/>, AIM: triryche206
PGP Key: <http://www.bergstrand.org/brian/misc/public_key.txt>
If all else fails, lower your standards.
As of 11:31:08 AM, iTunes is playing "Tristessa" from "Gish" by 
"Smashing Pumpkins"

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

iQA/AwUBQMnQZHnR2Fu2x7aiEQK+QgCeJynMXuz9NsR+HBh+LDGKjdDT5SUAnAqc
x2FZQ7uaURUzxOOTItxByl4D
=5IRG
-----END PGP SIGNATURE-----



More information about the freebsd-fs mailing list