[PATCH] Prefer fallocate if available, and use posix_fallocate only on Cygwin.

Jamie Lokier jamie at shareable.org
Sun Feb 24 16:29:17 GMT 2008

Wayne Davison wrote:
> On Sat, Feb 23, 2008 at 10:49:25PM -0500, Matt McCutchen wrote:
> > This change on top of the current preallocate branch implements the
> > behavior I described of using fallocate if available (Linux syscall that
> > uses filesystem-level preallocation support) or otherwise
> > posix_fallocate if on Cygwin.
> Very nice.  I added it to the preallocate branch and updated the patch.
> Thanks!

When compiled on a Linux system which doesn't have SYS_fallocate
(because it doesn't have a very recent kernel), but does have
posix_fallocate (because Glibc has had it for a while), I think that
patch will call Glibc's very slow function.

For example, both my up to date Debian and up to date Ubuntu Gutsy
boxes fit into that category.

I suspect it would be better not to call anything, rather than Glibc's
function.  This holds particularly for rsync daemons which might be
sent the option from an rsync client, and should ignore it (just like
daemons without the patch).

-- Jamie

More information about the rsync mailing list