Subject: Re: Supporting sector size != DEV_BSIZE
To: Greywolf <greywolf@starwolf.com>
From: Robert Elz <kre@munnari.OZ.AU>
List: tech-kern
Date: 06/12/2002 21:18:54
    Date:        Mon, 10 Jun 2002 12:02:00 -0700 (PDT)
    From:        Greywolf <greywolf@starwolf.com>
    Message-ID:  <Pine.NEB.4.44.0206101144510.18341-100000@lothlorien.starwolf.com>

  | 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.

frags are consolidated, but st_blksize units are too coarse.

  | 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.

Yes, that's why frags exist.  If that weren't possible frags would be
a total waste of time.

  | Question:  Is it legal to make a bsize:fsize of 1:1?

yes.   If you have plenty of space, make an 8k/8k filesys, you get to
avoid all the overheads of frag manipulation, your filesystem will
write faster (perhaps not measurably, but it will...)

The drawback is that you will waste lots of space on all the small
files (including symlinks, directories, ...) that tend to abound.

Before FFS was invented, numerous people made the unix filesys run faster
by simply using bigger blocks - the wasted space was the main drawback
(it isn't trivial, I think measurements showed in some cases it ran
around 30% or so - look at the old FFS papers, they have all that stuff
in them).   FFS allowed people to have the benefits of larger blocks
without most of the wastage, and it is frags that do that (nb: not without
any wastage, larger files never use frags, but the percentage lost there is
much smaller).

kre