On Tue, Apr 18, 2006 at 08:34:05PM -0400, Ming Zhang wrote:
> so u mean even there are preallocated space, file system should be able
> to know that is a hole, and that space is preallocated, not prewritten,
Preallocated space in XFS is not a hole - it is an unwritten extent.
That is different from a hole in that the extent has been physically
allocated, just marked as unwritten. Any attempt to read an unwritten
extent will return lots of zero, just like reading from a hole.
> and it will return all 0? where is this posix standard i can check? thx
posix_fallocate()? Except it doesn't define what the contents of
the area allocated must contain, and is not implemented on Linux
in the filesystems. Instead, it is poorly emulated in glibc
by writing chunks of zeros to disk and hence it returns zeros
when the space is read before it is "written".
R&D Software Enginner
SGI Australian Software Group