Re: Q: sparse file creation in existing data?

From: Daniel Phillips (
Date: Fri Jun 29 2001 - 10:03:41 EST

On Friday 29 June 2001 14:55, Ph. Marek wrote:
> Hmmm, on second thought ... But I'd like it better to have a fcntl for
> hole-making :-)
> Maybe I'll implement this myself.

A far superior interface would be:

    ssize_t sys_clear(unsigned int fd, size_t count)

A stub implementation would just write zeroes. You would need a generic way
of determining whether holes are supported for a particular file - this is
where an fcntl would be appropriate. It would also be nice to know this
before opening/creating a file, perhaps by fcntling the directory.

But don't expect to have a real, hole-creating implementation any time soon.
Taming the truncate races is hard enough as it is with a single boundary at
the end of a file. Taking care of multiple boundaries inside the file is
far, far harder. Talk to Al Viro or the Ext3 team if you want the whole ugly

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at
Please read the FAQ at

This archive was generated by hypermail 2b29 : Sat Jun 30 2001 - 21:00:22 EST