What, exactly, are stat.st_blocks, statfs.f_bsize?

Root Boy Jim rbj at uunet.UU.NET
Fri Mar 1 18:18:04 AEST 1991


In article <10283 at dog.ee.lbl.gov> torek at elf.ee.lbl.gov (Chris Torek) writes:

>[Reno is 512, Tahoe is 1024]
>Note that there may be (probably are) some systems out there in which
>st_blocks is in terms of 1 kbyte blocks; these should dwindle away,
>but will probably leave a lingering stench. :-)

Methinks the stench comes from POSIX, which gutlessly refused
to buck existing but ancient practice. I assume that's why BSD changed.

Oddly enuf, this came at a time when 1K FS blocks were becoming
more common in System V. It is a fortunate coincidence that
2^10 ~= 10^3. Too important not to take advantage of.

I was delighted when Berkeley "defined" a "block" as 1K. No more
doubling or halving in one's head when trying convert blocks to chars.

To make it worse, Pyramid's FS block sizes are 2K to 16K (yes, the
sectors are 2K), and so they report blocks in 2K increments. It is
rather sad to see filesystems quadruple in size when reported
between NFS partitions mounted to or from a Pyramid. Oh well...
-- 
		[rbj at uunet 1] stty sane
		unknown mode: sane



More information about the Comp.unix.wizards mailing list