xfs: refactor xfs_trans_roll

Split xfs_trans_roll into a low-level helper that just rolls the
actual transaction and a new higher level xfs_trans_roll_inode
that takes care of logging and rejoining the inode.  This gets
rid of the NULL inode case, and allows to simplify the special
cases in the deferred operation code.

Signed-off-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:
Christoph Hellwig 2017-08-28 10:21:03 -07:00 committed by Darrick J. Wong
parent f2e9ad212d
commit 411350df14
9 changed files with 48 additions and 56 deletions

View file

@ -1055,7 +1055,7 @@ xfs_dir_ialloc(
tp->t_flags &= ~(XFS_TRANS_DQ_DIRTY);
}
code = xfs_trans_roll(&tp, NULL);
code = xfs_trans_roll(&tp);
if (committed != NULL)
*committed = 1;
@ -1611,7 +1611,7 @@ xfs_itruncate_extents(
if (error)
goto out_bmap_cancel;
error = xfs_trans_roll(&tp, ip);
error = xfs_trans_roll_inode(&tp, ip);
if (error)
goto out;
}