Nathan Scott <nathans@xxxxxxx> writes:
> hi,
>
> On Sun, Sep 02, 2001 at 04:53:39AM +1000, monkeyiq wrote:
> >
> > So I was reading xfs_mkfile.c line 188 of 277
> > flck.l_whence = SEEK_SET;
> > flck.l_start = 0LL;
> > flck.l_len = size;
> > #if 0
> > (void)ioctl(fd, XFS_IOC_RESVSP64, &flck);
> >
>
> Hmm.... well I see the kernel code is all there. I'm
> guessing this was just overlooked during porting, so I've
> pushed in the change (mkfile does prealloc conditionally
> only, via the -p option).
>
> > I presume that this XFS_IOC_RESVSP64 tells XFS to reserve off a chunk of
> > space for future use by the file.
>
> Yes, pretty much.
>
> > Are the ioctl() calls for XFS documented anywhere?
>
> No, but they should be. Some of the documentation exists in
> the IRIX syssgi man page - I'll probably slap that into xfs(5)
> at some point.
I've found this page which I'll use as my reference to syssgi()
unless there is a better online version.
http://reality.sgi.com/cgi-bin/getman?syssgi-2#toc1
One interesting question about this call, if I have a file
(potentially with holes in it) that is, for example, 4Mb large
and issue a SEEK_SET, start=0, len=10Mb should this ioctl work?
Or is reserving space only valid from the end of file? From the
above interface it would seem that one can reserve space from
anywhere, eg, SEEK_CUR, start=1Mb, len=4Mb to reserve a 4 meg chunk
one meg down the pipe.
I would like to know when its best for
this call to be made, I am thinking as a extra param to file
creation in ferris, though I might also allow one to perform it
at any time so that a file can be extended with preallocation
when a new chunk of data is known to be coming and will be put
into that file.
-----------------------------------------------------
A new world order:
http://witme.sourceforge.net/libferris.web/
|