Re: [PATCH] xfs: factor out nodiscard helpers

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

 



This looks much better, and I think the diffstat speaks for itself..

Reviewed-by: Christoph Hellwig <hch@xxxxxx>

> diff --git a/fs/xfs/libxfs/xfs_bmap.c b/fs/xfs/libxfs/xfs_bmap.c
> index 24f60ee810e4..fd3c3be4d64a 100644
> --- a/fs/xfs/libxfs/xfs_bmap.c
> +++ b/fs/xfs/libxfs/xfs_bmap.c
> @@ -5107,15 +5107,15 @@ xfs_bmap_del_extent_real(
>  			if (error)
>  				goto done;
>  		} else {
> +			bool	skip_discard = false;
> +
>  			if ((bflags & XFS_BMAPI_NODISCARD) ||
> +			    (del->br_state == XFS_EXT_UNWRITTEN))

No need for the inner braces in the second statement.

> +				skip_discard = true;
> +
> +			__xfs_bmap_add_free(mp, dfops, del->br_startblock,
> +					    del->br_blockcount, NULL,
> +					    skip_discard);

In fact I'd avoid the variable entirely:

			__xfs_bmap_add_free(mp, dfops, del->br_startblock,
					del->br_blockcount, NULL,
					del->br_state == XFS_EXT_UNWRITTEN ||
					(bflags & XFS_BMAPI_NODISCARD));

--
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