[PATCH] Introduce SEEK_DATA/SEEK_HOLE support to XFS V1
Christoph Hellwig
hch at infradead.org
Sun Nov 20 09:30:13 CST 2011
On Sun, Nov 20, 2011 at 09:59:31PM +0800, Jeff Liu wrote:
> > fsb = XFS_B_TO_FSBT(mp, start_offset);
> > error = xfs_bmap_first_unused(NULL, ip, 1, &fsb,
> > XFS_DATA_FORK);
> > if (error)
> > return -error;
> >
> > if (fsb <= XFS_B_TO_FSBT(mp, start_offset))
> > return start_offset;
> > return XFS_FSB_TO_B(mp, fsb);
>
> Thanks for pointing it out, I even don't know XFS has this convenient routine at that time. :(
I didn't remember it either, but Dave has been working the dir code
which makes use of this funtion lately :)
Btw, the documentation for the function doesn't mention that it starts
searching for the hole only after the passed in block number, which
is something that could be improved.
More information about the xfs
mailing list