How to generate a large file allocating space

Ted Ts'o tytso at
Sat Nov 6 16:30:21 UTC 2010

On Fri, Nov 05, 2010 at 08:14:56AM +0000, Alex Bligh wrote:
> >Patches to do this wouldn't be that hard.  The harder part would
> >probably be the politics on fs-devel regarding the semantics of
> Also presumably there would be some pressure to make it work for
> every filesystem that supported fallocate().

No, I don't think so.  There are plenty of file systems that don't
support fallocate(), and it's not a short step to consider adding new
flags which might not be supported by all.

> Thaks, that's really helpful. Are the extents always the leaves? IE
> will next_leaf take me through extent by extent?

Yes, to both questions.

> Does your "please don't use this in production" warning apply to
> tst_extents.c or to the whole of lib/ext2fs? The library calls
> seem quite a good way to get the list of extents and are
> presumably what fsck etc. use.

No, only to tst_extents.c.  It has a tst_ prefix precisely because
it's a little hacky, and it was something that I had never intended to
be installed by distributions.  (I got a little burned by "filefrag",
which was never intended to be installed at distribution, which is why
the code is so hackish, and why it's not internationalized, etc.)  I
just want to make sure tst_extents doesn't similarly escape.

The libext2fs is designed to be a production-quality codebase, with a
stable ABI.  So feel free to use it in good health.  :-)

     	     	       		   	   	     - Ted

More information about the Ext3-users mailing list