Re: posix_fallocate

From: Guus Sliepen (guus@warande3094.warande.uu.nl)
Date: Fri Apr 14 2000 - 06:54:26 EST


On Fri, 14 Apr 2000, Momchil Velikov wrote:

> > 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.

> Wrong, sorry :-)
> This will change the file size, as reported by stat() and friends, but
> would not allocate any disk blocks for the "hole".
> Read from the hole will return zeros, but writes still
> have to allocate blocks.

Uh oh, seems like memory overcommit also applies to filesystems :) Well,
it's good to know anyway, I was planning to write a small dedicated
database myself too and I figured that would be a neat way to quickly
enlarge it... guess not.

Met vriendelijke groet,
Guus Sliepen.

-
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