[PATCH v7 4/4] xfs: xfs_seek_hole() refinement with hole searching from page cache for unwritten extent
Dave Chinner
david at fromorbit.com
Mon Aug 20 18:17:33 CDT 2012
On Mon, Aug 13, 2012 at 09:08:13PM +0800, Jeff Liu wrote:
> Improve xfs_seek_hole() to search hole offset from page cache for unwritten extents.
>
> Signed-off-by: Jie Liu <jeff.liu at oracle.com>
same as previous patch.
Reviewed-by: Dave Chinner <dchinner at redhat.com>
> + */
> + if (nmap == 1) {
> + offset = isize;
> + break;
> + }
>
> - holeoff = XFS_FSB_TO_B(mp, fsbno);
> - if (holeoff <= start)
> - offset = start;
> - else {
> /*
> - * xfs_bmap_first_unused() could return a value bigger than
> - * isize if there are no more holes past the supplied offset.
> + * Both mappings contains data, proceed to the next round of
> + * search if the current reading offset not beyond or hit EOF.
> */
> - offset = min_t(loff_t, holeoff, isize);
ASSERT(i > 1);
> + fsbno = map[i - 1].br_startoff + map[i - 1].br_blockcount;
> + start = XFS_FSB_TO_B(mp, fsbno);
> + if (start >= isize) {
> + offset = isize;
> + break;
> + }
> }
Cheers,
Dave.
--
Dave Chinner
david at fromorbit.com
More information about the xfs
mailing list