Re: posix_fallocate

From: Jamie Lokier (lk@tantalophile.demon.co.uk)
Date: Fri Apr 14 2000 - 03:59:23 EST


Ulrich Drepper wrote:
> int posix_fallocate (int fd, off_t offset, size_t len)
>
> The purpose of the function is to allocate enough storage so that
> future writes to the file in the range [offset,offset+len] cannot fail
> because the storage device has no room.
>
> I'm currently emulating this function in a ugly way in glibc: I write
> to every single block on the file. But this is by far not the best
> way. This function belongs into the kernel.

You could try using sendfile from /dev/zero -- that gives the kernel or
fs a chance to optimise that path in future.

-- Jamie

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Sat Apr 15 2000 - 21:00:24 EST