xfs: remove all boilerplate defer init/finish code
At this point, the transaction subsystem completely manages deferred items internally such that the common and boilerplate xfs_trans_alloc() -> xfs_defer_init() -> xfs_defer_finish() -> xfs_trans_commit() sequence can be replaced with a simple transaction allocation and commit. Remove all such boilerplate deferred ops code. In doing so, we change each case over to use the dfops in the transaction and specifically eliminate: - The on-stack dfops and associated xfs_defer_init() call, as the internal dfops is initialized on transaction allocation. - xfs_bmap_finish() calls that precede a final xfs_trans_commit() of a transaction. - xfs_defer_cancel() calls in error handlers that precede a transaction cancel. The only deferred ops calls that remain are those that are non-deterministic with respect to the final commit of the associated transaction or are open-coded due to special handling. 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:

committed by
Darrick J. Wong

szülő
91ef75b657
commit
c8eac49ef7
@@ -295,8 +295,6 @@ xfs_dquot_disk_alloc(
|
||||
|
||||
trace_xfs_dqalloc(dqp);
|
||||
|
||||
xfs_defer_init(tp, tp->t_dfops);
|
||||
|
||||
xfs_ilock(quotip, XFS_ILOCK_EXCL);
|
||||
if (!xfs_this_quota_on(dqp->q_mount, dqp->dq_flags)) {
|
||||
/*
|
||||
@@ -538,7 +536,6 @@ xfs_qm_dqread_alloc(
|
||||
struct xfs_buf **bpp)
|
||||
{
|
||||
struct xfs_trans *tp;
|
||||
struct xfs_defer_ops dfops;
|
||||
struct xfs_buf *bp;
|
||||
int error;
|
||||
|
||||
@@ -546,7 +543,6 @@ xfs_qm_dqread_alloc(
|
||||
XFS_QM_DQALLOC_SPACE_RES(mp), 0, 0, &tp);
|
||||
if (error)
|
||||
goto err;
|
||||
xfs_defer_init(tp, &dfops);
|
||||
|
||||
error = xfs_dquot_disk_alloc(&tp, dqp, &bp);
|
||||
if (error)
|
||||
|
Reference in New Issue
Block a user