preallocate CPU usage - pre4

Jamie Lokier
Sun, 24 Feb 2008 00:51:32 -0000

Rob Bosch wrote:
> I took a stab at modifying the preallocate.diff patch file replacing it
with
> ftruncate (attached).  Do you think the file looks OK for Linux (obviously
> cygwin should use posix_fallocate)?  I replaced posix_fallocate with
> ftruncate and also removed the check for HAVE_POSIX_FALLOCATE.
>
> Maybe this should be preallocate-linux.diff?

How will this help on Linux?  Changing the file size with ftruncate()
doesn't change the allocation process of disk blocks at all on
standard Linux filesystems; it just changes the size field in the
inode.

You can preallocate file space with recent Linux kernels, but it's not
done with ftruncate().

-- Jamie