[Gllug] Reiserfs faster boot

Nix nix at esperi.demon.co.uk
Wed Oct 10 18:22:15 UTC 2001


On Mon, 8 Oct 2001, Nick Hill said:
> On 07 Oct 2001 00:15:34 +0100
> "Darran D. Rimron-Molloy" <ddrm at digital-science.net> wrote:
> 
>> When you create a file that contains the same character repeated (ed,
>> cat /dev/zero into a file - say a couple of megs worth of 00000's ) it
>> won't take a couple of meg, it takes only a few bytes. That's a hole in
>> the file-system.

If that creates a hole it's a hack in the shell; it's not guaranteed to
do that.

>> Then again, how often do you create a hole in a file-system?

Whenever you're treating a file as a sparse database. The quota system
does that, as does bdb.

> The file containing zeros has been compressed by a factor of 1000.

It's not a compression scheme, just a way of efficiently storing zero
bytes.

> AFAIK a hole in the filesystem is an area of unallocated space. It is
> irrelevant whether this space contains zeros, random data or
> whatever. The filesystem describes it as being free for use. If part

No; it is defined to contain zeroes.

You create one by seek()ing (or fseek()ing) off the end of a file and
writing something there; the space between the end of the file and the
place where stuff was written is a hole. There is no way to convert
existing filespace into a hole (although there should be, and some OSes,
like AIX, have a nonstandard way to do that).

Writing in that hole (even writing zeroes) will allocate pieces of the
hole. It's surprising how many programs don't expect write() in the
middle of a file to return ENOSPC...

[snip irrelevant stuff about fragmentation; *anything* that extends a
file can fragment it, although some fsen are especially fragmentation-
resistant; there is nothing special about holes in this respect.]

-- 
`A truly dreadful film destined to be a cult classic for masochists.'
                                              --- Chris Priest on _A.I._.

-- 
Gllug mailing list  -  Gllug at linux.co.uk
http://list.ftech.net/mailman/listinfo/gllug




More information about the GLLUG mailing list