Re: [PATCH] Rebasing on Padraig's gnulib fallocate module and cleaning u
From:
Pádraig Brady
Subject:
Re: [PATCH] Rebasing on Padraig's gnulib fallocate module and cleaning up
Date:
Sat, 13 Jun 2009 01:19:36 +0100
User-agent:
Thunderbird 2.0.0.6 (X11/20071008)
Matěj Cepl wrote:
> Hi,
>
> the craziness around F11 finished so I am using a little bit of
> time I have to make one more round of my truncate/fallocate
> patch (together with mkfile script). I wanted to make my patch
> working with the Pádraig's fallocate gnulib module and clean up
> tests (they should all pass now).
Thanks Matěj!
A 10s look as I have to get some sleep :)
I was thinking that truncate --allocate would call posix_fallocate()
which guarantees that the file is allocated even if the filesystem
does not support fallocate(). I.E. we would need to add a
posix_fallocate() gnulib module that adds the function if not available,
and does what glibc does if fallocate() returns ENOSYS (write zeros).
On a related note it looks like fallocate64() which is required
on 32 bit systems will not be supported in glibc-2.10 as it
was released as a glibc-2.11 symbol. That means that 32 bit `cp`
built on glibc-2.10 will not allocate extents for a file,
and likewise 32 bit `truncate --allocate` will resort to writing
zeros when built on glibc-2.10.
Also I'm waiting for some clarification on the glibc fallocate() interface
as it seems a bit non standard and different from the latest man pages.
If I get that clarification I'll post my latest fallocate gnulib module,
or I'll post it soon in any case assuming that the interface can't
now be changed.
So in summary I would modify truncate to call posix_fallocate()
and just assume it is available for now. Then I can help with creating
a posix_fallocate() gnulib module when I get the fallocate() gnulib
module checked in.
cheers,
Pádraig.