tech-kern archive

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

Re: choosing the file system block size



> [I]s it a reasonable assumption that the space allocated to a file
> will be the file's data size, rounded up to the fragment size?

Yes and no.

I'm assuming you're talking FFS here.  (I don't know any other
filesystem well enough to answer for it.)

For files small enough there's no need for indirect blocks, this is
true, at least if you ignore the space used by the inode.

For files large enough to need indirect blocks, (a) the size is rounded
up to the block size, not the frag size, and (b) you also need to
account for indirect blocks.

And all of the above assumes you either have no holes in your files or
are satisfied with the amount of space that would be used if the holes
were filled in.  Detecting holes without going under the filesystem's
hood is...nontrivial.

/~\ The ASCII                             Mouse
\ / Ribbon Campaign
 X  Against HTML                mouse%rodents-montreal.org@localhost
/ \ Email!           7D C8 61 52 5D E7 2D 39  4E F1 31 3E E8 B3 27 4B


Home | Main Index | Thread Index | Old Index