aboutsummaryrefslogtreecommitdiffstats
path: root/fs/xfs/libxfs/xfs_alloc.c
diff options
context:
space:
mode:
authorBrian Foster <bfoster@redhat.com>2018-08-01 10:20:34 -0400
committerDarrick J. Wong <darrick.wong@oracle.com>2018-08-03 02:05:14 -0400
commit0f37d1780c3d864599fb377dcb47ad1aa0686b4e (patch)
tree4b54695109c61c7a5141636a89ba0ede57312585 /fs/xfs/libxfs/xfs_alloc.c
parent1ae093cbea3d1ef04e1344b9e3996a9e1763a91b (diff)
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 <bfoster@redhat.com> Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com> Reviewed-by: Christoph Hellwig <hch@lst.de> [darrick: fix unused variable warnings with ftrace disabled] Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Diffstat (limited to 'fs/xfs/libxfs/xfs_alloc.c')
-rw-r--r--fs/xfs/libxfs/xfs_alloc.c9
1 files changed, 4 insertions, 5 deletions
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(
2198 */ 2198 */
2199STATIC void 2199STATIC void
2200xfs_defer_agfl_block( 2200xfs_defer_agfl_block(
2201 struct xfs_mount *mp, 2201 struct xfs_trans *tp,
2202 struct xfs_defer_ops *dfops,
2203 xfs_agnumber_t agno, 2202 xfs_agnumber_t agno,
2204 xfs_fsblock_t agbno, 2203 xfs_fsblock_t agbno,
2205 struct xfs_owner_info *oinfo) 2204 struct xfs_owner_info *oinfo)
2206{ 2205{
2206 struct xfs_mount *mp = tp->t_mountp;
2207 struct xfs_extent_free_item *new; /* new element */ 2207 struct xfs_extent_free_item *new; /* new element */
2208 2208
2209 ASSERT(xfs_bmap_free_item_zone != NULL); 2209 ASSERT(xfs_bmap_free_item_zone != NULL);
@@ -2216,7 +2216,7 @@ xfs_defer_agfl_block(
2216 2216
2217 trace_xfs_agfl_free_defer(mp, agno, 0, agbno, 1); 2217 trace_xfs_agfl_free_defer(mp, agno, 0, agbno, 1);
2218 2218
2219 xfs_defer_add(dfops, XFS_DEFER_OPS_TYPE_AGFL_FREE, &new->xefi_list); 2219 xfs_defer_add(tp, XFS_DEFER_OPS_TYPE_AGFL_FREE, &new->xefi_list);
2220} 2220}
2221 2221
2222/* 2222/*
@@ -2325,8 +2325,7 @@ xfs_alloc_fix_freelist(
2325 2325
2326 /* defer agfl frees if dfops is provided */ 2326 /* defer agfl frees if dfops is provided */
2327 if (tp->t_dfops) { 2327 if (tp->t_dfops) {
2328 xfs_defer_agfl_block(mp, tp->t_dfops, args->agno, 2328 xfs_defer_agfl_block(tp, args->agno, bno, &targs.oinfo);
2329 bno, &targs.oinfo);
2330 } else { 2329 } else {
2331 error = xfs_free_agfl_block(tp, args->agno, bno, agbp, 2330 error = xfs_free_agfl_block(tp, args->agno, bno, agbp,
2332 &targs.oinfo); 2331 &targs.oinfo);