Re: [PATCH v2 15/15] xfs: bypass final dfops roll in trans commit path

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

 



> +xfs_defer_finish(
> +	struct xfs_trans	**tp)
> +{
> +	int			error;
> +
> +	/*
> +	 * Finish and roll the transaction once more to avoid returning to the
> +	 * caller with a dirty transaction.
> +	 */
> +	error = xfs_defer_finish_noroll(tp);
> +	if (!error && ((*tp)->t_flags & XFS_TRANS_DIRTY))
> +		error = xfs_defer_trans_roll(tp);
> +	if (!error)
> +		xfs_defer_reset((*tp)->t_dfops);
>  
>  	return error;

Nitpick: I'd write this as:

	error = xfs_defer_finish_noroll(tp);
	if (error)
		return error;

	if ((*tp)->t_flags & XFS_TRANS_DIRTY) {
		error = xfs_defer_trans_roll(tp);
		if (error)
			return error;
	}

	xfs_defer_reset((*tp)->t_dfops);
	return 0;

Otherwise this looks fine:

Reviewed-by: Christoph Hellwig <hch@xxxxxx>
--
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