How to generate a large file allocating space

Ted Ts'o tytso at
Tue Nov 2 01:49:46 UTC 2010

On Mon, Nov 01, 2010 at 10:58:12PM +0000, Alex Bligh wrote:
> High bandwidth I/O to the underlying disk is part of it - only one
> reader/writer per file. We're really using ext4 just for its extents
> capability, i.e. allocating space, plus the convenience of directory
> lookup to find the set of extents.
> It's easier to do this than to write this bit from scratch, and the
> files are pretty static in size (i.e. they only grow, and grow
> infrequently by large amounts). The files on ext4 correspond to large
> chunks of disks we are combining together using an device-mapper
> type thing (but different), and on top of that lives arbitary real
> filing systems. Because our device-mapper type thing already
> understands what blocks have been written to, we already have a layer
> that prevents the data on the disk before the file's creation being
> exposed. That's why I don't need ext4 to zero them out. I suppose
> in that sense it is like the swap file case.

But why not just use O_DIRECT?  Do you really need to access the
disk directly, as opposed to using O_DIRECT?

						- Ted

More information about the Ext3-users mailing list