Daniel P. Berrange wrote:
On Mon, Apr 27, 2009 at 02:10:10PM -0500, Eric Sandeen wrote:
> Now that we have ext4 as the new default filesystem, it'd be nice if we
> can get more applications to take advantage of some of the features.
>
> One big feature that has already been brought up on the list[1] is file
> preallocation, which allows an application to pre-allocate blocks it
> knows that it will eventually write into, thereby making sure it won't
> run out of space, and also generally getting a more efficient/contiguous
> file layout.
>
> * Come up with a list of apps which could benefit:
[snip]
> - virt image tools?
We're one step ahead of you ! libvirt supports it as of 0.6.3 for its
raw file storage management APIs, and this is in Fedora 11 trees
Cool!
Ah, that explains the call to posix_fallocate() I saw in the library :)
Just FWIW, this will still be slow on ext3, but fast on
ext4/xfs/btrfs/ocfs2 - as Amit's blog entry shows, I guess.
If you didn't want to fall back to the slow behavior on ext3, you might
consider only using fallocate() if it's there, rather than
posix_fallocate(). But the behavior is up to you of course. :)
-Eric