Subject: Re: Supporting sector size != DEV_BSIZE
To: Ben Harris <bjh21@netbsd.org>
From: Greywolf <greywolf@starwolf.com>
List: tech-kern
Date: 06/10/2002 12:02:00
It originally seemed to me that the obvious thing to do would be to
specify st_blocks in term of st_blksize, but that's not entirely
accurate unless frags are consolidated, or unless you count incomplete
blocks as blocks allocated to that file.  But *that's* not accurate
either, since files (if I understand my FFS basics from a while ago) can
have frags in blocks with frags from OTHER files.

So having a constant size seems mostly appropriate.  I think st_blocks
and st_bsize were probably most useful -- or would have been most
useful, had they chosen to use them in that way -- on the original UFS,
where blocks were a constant size (no such thing as a frag size).

Question:  Is it legal to make a bsize:fsize of 1:1?
[never mind the ramifications of doing so; just wanted to know if it was
 permissible under our FS.]

On Mon, 10 Jun 2002, Ben Harris wrote:

# I think that .1-2001/Cor1-2002 is meant to introduce some informative text
# explaining that the block size of st_blocks is unrelated to any other "block
# size" in the standard, and may not even be constant across an implementation
# (NFS mounts from HP-UX systems being a fun example).  The field is pretty
# close to meaningless in current POSIX -- suggestions on how it should be
# specified are probably welcome.
#
# >Neither of the standard drafts I looked at mentions the macro S_BLKSIZE,
# >but we have it in <sys/stat.h> defined as 512.
#
# Hmm.  I'll mention this to the Austin Group, since they were looking for
# prior art in this area.
#
# --
# Ben Harris                                                   <bjh21@netbsd.org>
# Portmaster, NetBSD/acorn26           <URL:http://www.netbsd.org/Ports/acorn26/>
#


				--*greywolf;
--
NetBSD: Groovy Baby!