On 09/14/2011 03:06 PM, Eric Blake wrote: > On 09/13/2011 11:55 PM, Kelly Anderson wrote: >> Hi, >> >> I put together a patch 2 or 3 years ago (back when posix_fallocate was >> first introduced in glibc). > > Thanks for the effort. However, this has been discussed in the past, and the > consensus was that we should first write a patch to gnulib that provides a > posix_fallocate() stub for all platforms, so that coreutils can > unconditionally call posix_fallocate, rather than making coreutils have to > use #ifdef. Among other things, a gnulib module would make it possible to > emulate posix_fallocate() even on older glibc where it is missing or broken. >
Also we probably want fallocate() for this use case rather than posix_fallocate() in any case, as we don't want to fall back to writing zeros. Also I had a whole lot of fallocate() things to try once the fiemap() stuff landed, but unfortunately that doesn't work reliably on all file systems and is currently restricted to sparse files. So I need to dig out my notes on how to apply fallocate() to files with holes and "empty portions" again. cheers, Pádraig.
