NetBSD-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: Beating a dead horse

kre%munnari.OZ.AU@localhost (Robert Elz) writes:

>But how does the upper layer know what it is supposed to do if the
>information has been buried?

The newfs command queries the sector size, calculates
the filesystem parameters and puts them into the superblock.

>  FFS won't (or shouldn't) allow frag
>sizes smaller than the sector size, but in order to do that it has to
>be told the correct sector size.   If the underlying pseudo-device lies
>to it, the upper layers cannot possibly do the correct thing.

FFS and other filesystems don't even try to get that information
(basically because in older times it wasn't possible or needed).
Instead, the information is stored as filesystem metadata (e.g. the

FFS used to get the physical sector size from the superblock. In
NetBSD only userland tools still do that, the kernel code just
ignores it but pretends to address a DEV_BSIZE disk. The calculated
fragment size assures that there are no alignment issues.

                                Michael van Elst
                                "A potential Snark may lurk in every tree."

Home | Main Index | Thread Index | Old Index