summaryrefslogtreecommitdiff
path: root/fs/xfs/xfs_extfree_item.c
diff options
context:
space:
mode:
authorDarrick J. Wong <djwong@kernel.org>2023-04-12 04:59:53 +0300
committerDarrick J. Wong <djwong@kernel.org>2023-04-12 04:59:53 +0300
commitb2ccab3199aa7cea9154d80ea2585312c5f6eba0 (patch)
tree9c9470ad68210809dc45698a1ab0f64a8b332190 /fs/xfs/xfs_extfree_item.c
parent774a99b47b588bf0bd9f65d3b241d5bba0b2fcb0 (diff)
downloadlinux-b2ccab3199aa7cea9154d80ea2585312c5f6eba0.tar.xz
xfs: pass per-ag references to xfs_free_extent
Pass a reference to the per-AG structure to xfs_free_extent. Most callers already have one, so we can eliminate unnecessary lookups. The one exception to this is the EFI code, which the next patch will fix. Signed-off-by: Darrick J. Wong <djwong@kernel.org> Reviewed-by: Dave Chinner <dchinner@redhat.com>
Diffstat (limited to 'fs/xfs/xfs_extfree_item.c')
-rw-r--r--fs/xfs/xfs_extfree_item.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/fs/xfs/xfs_extfree_item.c b/fs/xfs/xfs_extfree_item.c
index 011b50469301..c1aae07467c9 100644
--- a/fs/xfs/xfs_extfree_item.c
+++ b/fs/xfs/xfs_extfree_item.c
@@ -350,6 +350,7 @@ xfs_trans_free_extent(
struct xfs_owner_info oinfo = { };
struct xfs_mount *mp = tp->t_mountp;
struct xfs_extent *extp;
+ struct xfs_perag *pag;
uint next_extent;
xfs_agnumber_t agno = XFS_FSB_TO_AGNO(mp,
xefi->xefi_startblock);
@@ -366,9 +367,12 @@ xfs_trans_free_extent(
trace_xfs_bmap_free_deferred(tp->t_mountp, agno, 0, agbno,
xefi->xefi_blockcount);
- error = __xfs_free_extent(tp, xefi->xefi_startblock,
- xefi->xefi_blockcount, &oinfo, XFS_AG_RESV_NONE,
+ pag = xfs_perag_get(mp, agno);
+ error = __xfs_free_extent(tp, pag, agbno, xefi->xefi_blockcount,
+ &oinfo, XFS_AG_RESV_NONE,
xefi->xefi_flags & XFS_EFI_SKIP_DISCARD);
+ xfs_perag_put(pag);
+
/*
* Mark the transaction dirty, even on error. This ensures the
* transaction is aborted, which: