Re: [RFC] Heads up on sys_fallocate()

From: Ulrich Drepper
Date: Mon Mar 05 2007 - 10:50:55 EST


JÃrn Engel wrote:
>> Of course. You call posix_fallocate once for the lifetime of the file
>> when it is created to ensure that all future uses will work.
>
> That part is not quite clear from the manpage but I trust most people
> would assume the same.

Not only that, it is what this function is for. In the POSIX committee
we've looked at the functions in detail before adding them, even if some
information is not in the man page but instead in the Rationale.


> Still, it is quite obvious that noone designing this interface has lost
> much thought to compressing filesystems.

You already have problems with supporting the functionality
posix_fallocate is supporting. You cannot reliably support MAP_SHARED
files if all of a sudden the compression causes and expansion of a block
and that causes a ENOSPC error. So, don't expect pity. This is a
function in support of a real and reliable implementation of memory
mapped files. You don't use MAP_SHARED on such filesystems, it'll eat
your kittens sooner or later anyway.

--
â Ulrich Drepper â Red Hat, Inc. â 444 Castro St â Mountain View, CA â

Attachment: signature.asc
Description: OpenPGP digital signature