Re: [PATCH 05/21] xfs: add BMAPI_NORMAP flag to perform block remapping without updating rmapbt

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Apr 02, 2018 at 12:56:47PM -0700, Darrick J. Wong wrote:
> From: Darrick J. Wong <darrick.wong@xxxxxxxxxx>
> 
> Add a new flag, XFS_BMAPI_NORMAP, which will perform file block
> remapping without updating the rmapbt.  This will be used by the repair
> code to reconstruct bmbts from the rmapbt, in which case we don't want
> the rmapbt update.
> 
> Signed-off-by: Darrick J. Wong <darrick.wong@xxxxxxxxxx>
> ---
>  fs/xfs/libxfs/xfs_bmap.c |   25 ++++++++++++++++---------
>  fs/xfs/libxfs/xfs_bmap.h |    6 +++++-
>  2 files changed, 21 insertions(+), 10 deletions(-)
> 
> 
> diff --git a/fs/xfs/libxfs/xfs_bmap.c b/fs/xfs/libxfs/xfs_bmap.c
> index 3b03d88..519ef9c 100644
> --- a/fs/xfs/libxfs/xfs_bmap.c
> +++ b/fs/xfs/libxfs/xfs_bmap.c
> @@ -1998,9 +1998,12 @@ xfs_bmap_add_extent_delay_real(
>  	}
>  
>  	/* add reverse mapping */
> -	error = xfs_rmap_map_extent(mp, bma->dfops, bma->ip, whichfork, new);
> -	if (error)
> -		goto done;
> +	if (!(bma->flags & XFS_BMAPI_NORMAP)) {
> +		error = xfs_rmap_map_extent(mp, bma->dfops, bma->ip,
> +				whichfork, new);
> +		if (error)
> +			goto done;
> +	}

Double negatives are a bit hard to parse (not NORMAP) but I don't
have a better idea for this.

....

> @@ -4119,7 +4125,8 @@ xfs_bmapi_allocate(
>  	else
>  		error = xfs_bmap_add_extent_hole_real(bma->tp, bma->ip,
>  				whichfork, &bma->icur, &bma->cur, &bma->got,
> -				bma->firstblock, bma->dfops, &bma->logflags);
> +				bma->firstblock, bma->dfops, &bma->logflags,
> +				bma->flags);

Ob: The number of function parameters is starting to get out of hand
again :/

Regardless,

Reviewed-by: Dave Chinner <dchinner@xxxxxxxxxx>

-- 
Dave Chinner
david@xxxxxxxxxxxxx
--
To unsubscribe from this list: send the line "unsubscribe linux-xfs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [XFS Filesystem Development (older mail)]     [Linux Filesystem Development]     [Linux Audio Users]     [Yosemite Trails]     [Linux Kernel]     [Linux RAID]     [Linux SCSI]


  Powered by Linux