From 0f37d1780c3d864599fb377dcb47ad1aa0686b4e Mon Sep 17 00:00:00 2001 From: Brian Foster Date: Wed, 1 Aug 2018 07:20:34 -0700 Subject: xfs: pass transaction to xfs_defer_add() The majority of remaining references to struct xfs_defer_ops in XFS are associated with xfs_defer_add(). At this point, there are no more external xfs_defer_ops users left. All instances of xfs_defer_ops are embedded in the transaction, which means we can safely pass the transaction down to the dfops add interface. Update xfs_defer_add() to receive the transaction as a parameter. Various subsystems implement wrappers to allocate and construct the context specific data structures for the associated deferred operation type. Update these to also carry the transaction down as needed and clean up unused dfops parameters along the way. This removes most of the remaining references to struct xfs_defer_ops throughout the code and facilitates removal of the structure. Signed-off-by: Brian Foster Reviewed-by: Darrick J. Wong Reviewed-by: Christoph Hellwig [darrick: fix unused variable warnings with ftrace disabled] Signed-off-by: Darrick J. Wong --- fs/xfs/libxfs/xfs_alloc.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'fs/xfs/libxfs/xfs_alloc.c') diff --git a/fs/xfs/libxfs/xfs_alloc.c b/fs/xfs/libxfs/xfs_alloc.c index 9847c1632712..5580b6e23bb3 100644 --- a/fs/xfs/libxfs/xfs_alloc.c +++ b/fs/xfs/libxfs/xfs_alloc.c @@ -2198,12 +2198,12 @@ xfs_agfl_reset( */ STATIC void xfs_defer_agfl_block( - struct xfs_mount *mp, - struct xfs_defer_ops *dfops, + struct xfs_trans *tp, xfs_agnumber_t agno, xfs_fsblock_t agbno, struct xfs_owner_info *oinfo) { + struct xfs_mount *mp = tp->t_mountp; struct xfs_extent_free_item *new; /* new element */ ASSERT(xfs_bmap_free_item_zone != NULL); @@ -2216,7 +2216,7 @@ xfs_defer_agfl_block( trace_xfs_agfl_free_defer(mp, agno, 0, agbno, 1); - xfs_defer_add(dfops, XFS_DEFER_OPS_TYPE_AGFL_FREE, &new->xefi_list); + xfs_defer_add(tp, XFS_DEFER_OPS_TYPE_AGFL_FREE, &new->xefi_list); } /* @@ -2325,8 +2325,7 @@ xfs_alloc_fix_freelist( /* defer agfl frees if dfops is provided */ if (tp->t_dfops) { - xfs_defer_agfl_block(mp, tp->t_dfops, args->agno, - bno, &targs.oinfo); + xfs_defer_agfl_block(tp, args->agno, bno, &targs.oinfo); } else { error = xfs_free_agfl_block(tp, args->agno, bno, agbp, &targs.oinfo); -- cgit