xfs: saner xfs_trans_commit interface

The flags argument to xfs_trans_commit is not useful for most callers, as
a commit of a transaction without a permanent log reservation must pass
0 here, and all callers for a transaction with a permanent log reservation
except for xfs_trans_roll must pass XFS_TRANS_RELEASE_LOG_RES.  So remove
the flags argument from the public xfs_trans_commit interfaces, and
introduce low-level __xfs_trans_commit variant just for xfs_trans_roll
that regrants a log reservation instead of releasing it.

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:48:08 +10:00
committed by Dave Chinner
parent 4906e21545
commit 70393313dd
24 changed files with 68 additions and 74 deletions

View File

@@ -1215,7 +1215,7 @@ xfs_bmap_add_attrfork(
error = xfs_bmap_finish(&tp, &flist, &committed);
if (error)
goto bmap_cancel;
error = xfs_trans_commit(tp, XFS_TRANS_RELEASE_LOG_RES);
error = xfs_trans_commit(tp);
xfs_iunlock(ip, XFS_ILOCK_EXCL);
return error;
@@ -5926,8 +5926,7 @@ xfs_bmap_split_extent(
if (error)
goto out;
return xfs_trans_commit(tp, XFS_TRANS_RELEASE_LOG_RES);
return xfs_trans_commit(tp);
out:
xfs_trans_cancel(tp);