Re: Q: sparse file creation in existing data?

Daniel Phillips (phillips@bonn-fries.net)
Fri, 29 Jun 2001 17:03:41 +0200


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

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