posix_fallocate is a POSIX optional system call that allows to reserve space for a file. It guarantees that subsequent writes will not fail if the total written amount doesn’t exceed the allocated amount of space.
Its big advantage is that when the space is allocated, the kernel tries to allocate contiguous disk blocks, which will speed up IO operations.
It was recently submitted and accepted to Erlang/OTP:
http://www.erlang.org/cgi-bin/ezmlm-cgi?3:sss:1716:201012:mdkoigfchoccmjhpglji#b
https://github.com/erlang/otp/commit/ea3dfb992c769a7d47de1892284b125212d13179
Advertisement