xfs: drop unnecessary xfs_defer_finish() dfops parameter

Every caller of xfs_defer_finish() now passes the transaction and
its associated ->t_dfops. The xfs_defer_ops parameter is therefore
no longer necessary and can be removed.

Since most xfs_defer_finish() callers also have to consider
xfs_defer_cancel() on error, update the latter to also receive the
transaction for consistency. The log recovery code contains an
outlier case that cancels a dfops directly without an available
transaction. Retain an internal wrapper to support this outlier case
for the time being.

Signed-off-by: Brian Foster <bfoster@redhat.com>
Reviewed-by: Bill O'Donnell <billodo@redhat.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
This commit is contained in:
Brian Foster 2018-07-24 13:43:15 -07:00 committed by Darrick J. Wong
parent d5cca7eb24
commit 9e28a242be
11 changed files with 46 additions and 38 deletions

View file

@ -933,9 +933,9 @@ __xfs_trans_commit(
/* finish deferred items on final commit */
if (!regrant && tp->t_dfops) {
error = xfs_defer_finish(&tp, tp->t_dfops);
error = xfs_defer_finish(&tp);
if (error) {
xfs_defer_cancel(tp->t_dfops);
xfs_defer_cancel(tp);
goto out_unreserve;
}
}
@ -1030,7 +1030,7 @@ xfs_trans_cancel(
trace_xfs_trans_cancel(tp, _RET_IP_);
if (tp->t_dfops)
xfs_defer_cancel(tp->t_dfops);
xfs_defer_cancel(tp);
/*
* See if the caller is relying on us to shut down the
@ -1111,3 +1111,10 @@ xfs_trans_roll(
tres.tr_logflags = XFS_TRANS_PERM_LOG_RES;
return xfs_trans_reserve(*tpp, &tres, 0, 0);
}
void
xfs_defer_cancel(
struct xfs_trans *tp)
{
__xfs_defer_cancel(tp->t_dfops);
}