Jeff Liu | 13 Aug 2012 15:08
Picon
Favicon

[PATCH v7 4/4] xfs: xfs_seek_hole() refinement with hole searching from page cache for unwritten extent

Improve xfs_seek_hole() to search hole offset from page cache for unwritten extents.

Signed-off-by: Jie Liu <jeff.liu <at> oracle.com>
---
 fs/xfs/xfs_file.c |   76 +++++++++++++++++++++++++++++++++++++++++++++-------
 1 files changed, 65 insertions(+), 11 deletions(-)

diff --git a/fs/xfs/xfs_file.c b/fs/xfs/xfs_file.c
index 43b3718..a537f61 100644
--- a/fs/xfs/xfs_file.c
+++ b/fs/xfs/xfs_file.c
 <at>  <at>  -1288,9 +1288,9  <at>  <at>  xfs_seek_hole(
 	struct xfs_inode	*ip = XFS_I(inode);
 	struct xfs_mount	*mp = ip->i_mount;
 	loff_t			uninitialized_var(offset);
-	loff_t			holeoff;
 	xfs_fsize_t		isize;
 	xfs_fileoff_t		fsbno;
+	xfs_filblks_t		end;
 	uint			lock;
 	int			error;

 <at>  <at>  -1306,21 +1306,75  <at>  <at>  xfs_seek_hole(
 	}

 	fsbno = XFS_B_TO_FSBT(mp, start);
-	error = xfs_bmap_first_unused(NULL, ip, 1, &fsbno, XFS_DATA_FORK);
-	if (error)
-		goto out_unlock;
+	end = XFS_B_TO_FSB(mp, isize);
(Continue reading)

Mark Tinguely | 20 Aug 2012 20:21
Picon
Favicon

Re: [PATCH v7 4/4] xfs: xfs_seek_hole() refinement with hole searching from page cache for unwritten extent

On 08/13/12 08:08, 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>

Looks good.

Reviewed-by: Mark Tinguely <tinguely <at> sgi.com>

_______________________________________________
xfs mailing list
xfs <at> oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

Dave Chinner | 21 Aug 2012 01:17

Re: [PATCH v7 4/4] xfs: xfs_seek_hole() refinement with hole searching from page cache for unwritten extent

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;
(Continue reading)


Gmane