Re: Introduce SEEK_DATA/SEEK_HOLE to XFS V5

Christoph Hellwig
2012-01-12T16:41:49Z

On Thu, Jan 12, 2012 at 09:01:48AM -0600, Mark Tinguely wrote:
> >Sorry, am was well understood your opinions in this point for now.
> >IMHO, we can only find and return the data buffer offset at a dirty or
> >unwritten page once the first page was probed.
> >
>
> From my tests, xfs_bmapi_read() can only find holes if they cross or
> start on a 64KB boundary. It would be nice if unwritten extents were
> at least that good at finding holes.

Are you testing on ia64 with 64k blocks? :) xfs_bmapi_read will
find holes down to block granularity, that's how it's implemented.
However recent XFS does fairly aggressive preallocation, so you probably
won't find small holes unless you explicitly punch them out using
XFS_IOC_UNRESVSP or fallocate with the hole punch flag.