Re: posix_fallocate

From: Ulrich Drepper (drepper@redhat.com)
Date: Fri Apr 14 2000 - 10:56:15 EST


Guus Sliepen <guus@warande3094.warande.uu.nl> writes:

> Isn't it possible to just seek to offset+len and write a null byte
> there? I thought (but I really don't know for sure) that would allocate
> the space needed on the filesystem, and with some "sparse" file
> optimalisation, this would be real quick on ext2.

Well, seeking is not an option since the file position must not
change. But with pwrite you can emulate the function (and this is
what I do in the moment). But this is horribly inefficient. The
kernel can do this much better.

-- 
---------------.      drepper at gnu.org  ,-.   1325 Chesapeake Terrace
Ulrich Drepper  \    ,-------------------'   \  Sunnyvale, CA 94089 USA
Red Hat          `--' drepper at redhat.com   `------------------------

- 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