xfs: remove the flags argument to xfs_trans_cancel

xfs_trans_cancel takes two flags arguments: XFS_TRANS_RELEASE_LOG_RES and
XFS_TRANS_ABORT.  Both of them are a direct product of the transaction
state, and can be deducted:

 - any dirty transaction needs XFS_TRANS_ABORT to be properly canceled,
   and XFS_TRANS_ABORT is a noop for a transaction that is not dirty.
 - any transaction with a permanent log reservation needs
   XFS_TRANS_RELEASE_LOG_RES to be properly canceled, and passing
   XFS_TRANS_RELEASE_LOG_RES for a transaction without a permanent
   log reservation is invalid.

So just remove the flags argument and do the right thing.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
This commit is contained in:
Christoph Hellwig
2015-06-04 13:47:56 +10:00
committed by Dave Chinner
parent eacb24e734
commit 4906e21545
22 changed files with 104 additions and 171 deletions

View File

@@ -411,7 +411,7 @@ xfs_attr_inactive(xfs_inode_t *dp)
trans = xfs_trans_alloc(mp, XFS_TRANS_ATTRINVAL);
error = xfs_trans_reserve(trans, &M_RES(mp)->tr_attrinval, 0, 0);
if (error) {
xfs_trans_cancel(trans, 0);
xfs_trans_cancel(trans);
return error;
}
xfs_ilock(dp, XFS_ILOCK_EXCL);
@@ -444,7 +444,7 @@ xfs_attr_inactive(xfs_inode_t *dp)
return error;
out:
xfs_trans_cancel(trans, XFS_TRANS_RELEASE_LOG_RES|XFS_TRANS_ABORT);
xfs_trans_cancel(trans);
xfs_iunlock(dp, XFS_ILOCK_EXCL);
return error;
}