Re: [Fwd: [linux-audio-dev] info point on linux hdr]

New Message Reply About this list Date view Thread view Subject view Author view Other groups

Subject: Re: [Fwd: [linux-audio-dev] info point on linux hdr]
From: Andi Kleen (ak_AT_muc.de)
Date: Sat Apr 15 2000 - 02:35:10 EEST


On Sat, Apr 15, 2000 at 12:24:16AM +0200, Andrew Clausen wrote:
> i mentioned in some remarks to benno how important i thought it was to
> preallocate the files used for hard disk recording under linux.

[...]

Unfortunately efficient preallocation is rather hard with the current
ext2. To do it efficiently you just want to allocate the blocks in the
bitmaps without writing into the actual allocated blocks (otherwise
it would be as slow as the manual write-every-block-from-userspace trick)
Now in these blocks there could be data from other files, the new owner
of the block should not be allowed to see the old data for security reasons.

You suddenly get a new special kind of block in the file system with
different semantics: ignore old data and only supply zeroes to the reader,
unless the block has been actually writen.

This ``ignore old data until writen'' information about the block would
need to be persistent on disk -- you cannot just hold it in memory,
otherwise it would not be known anymore after a reboot/crash. Filling
the unwriten blocks with zeroes on shutdown would be too slow[1].

The problem is that ext2 has no space to store this information. The blocks
are allocated using simple bitmaps, and you cannot express three states
(free, allocated, write-only) in only a single bit. If you were using a
extent based file system there would be probably enough space (you usually
find space for a single bit somewhere in the extent tree), but with
bitmaps it is tricky and would require on disk format changes.

Apparently extent based ext2 is planned, maybe it would be useful to
include that feature then, but before that it looks too hairy.

JFS and XFS seem to support these things already.

-Andi

[1] Imagine your system starting a 100MB write when the UPS tries to force
a quick shutdown on power fail -- you really don't want that.


New Message Reply About this list Date view Thread view Subject view Author view Other groups

This archive was generated by hypermail 2b28 : Sat Apr 15 2000 - 03:07:23 EEST