xfs
[Top] [All Lists]

Re: [PATCH v7 4/4] xfs: xfs_seek_hole() refinement with hole searching f

To: Jeff Liu <jeff.liu@xxxxxxxxxx>
Subject: Re: [PATCH v7 4/4] xfs: xfs_seek_hole() refinement with hole searching from page cache for unwritten extent
From: Dave Chinner <david@xxxxxxxxxxxxx>
Date: Tue, 21 Aug 2012 09:17:33 +1000
Cc: xfs@xxxxxxxxxxx
In-reply-to: <5028FC3D.8000007@xxxxxxxxxx>
References: <5028FC3D.8000007@xxxxxxxxxx>
User-agent: Mutt/1.5.21 (2010-09-15)
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@xxxxxxxxxx>

same as previous patch.

Reviewed-by: Dave Chinner <dchinner@xxxxxxxxxx>

> +              */
> +             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@xxxxxxxxxxxxx

<Prev in Thread] Current Thread [Next in Thread>