]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commitdiff
xfs: remove the agno argument to xfs_free_ag_extent
authorChristoph Hellwig <hch@lst.de>
Mon, 25 Nov 2024 21:14:12 +0000 (13:14 -0800)
committerDarrick J. Wong <djwong@kernel.org>
Tue, 24 Dec 2024 02:01:23 +0000 (18:01 -0800)
Source kernel commit: db129fa01113f767d5b7a6fd339114a962023464

xfs_free_ag_extent already has a pointer to the pag structure through
the agf buffer.  Use that instead of passing the redundant argument,
and do the same for the tracepoint.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Darrick J. Wong <djwong@kernel.org>
Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
include/xfs_trace.h
libxfs/defer_item.c
libxfs/xfs_alloc.c
libxfs/xfs_alloc.h

index f6d6a6ea1af9e1a3c01220edb69bf639930b34f6..ba51419b3df3d39df249cccce3b7912212eff656 100644 (file)
@@ -79,7 +79,7 @@
 #define trace_xfs_btree_free_block(...)                ((void) 0)
 #define trace_xfs_btree_alloc_block(...)       ((void) 0)
 
-#define trace_xfs_free_extent(a,b,c,d,e,f,g)   ((void) 0)
+#define trace_xfs_free_extent(...)             ((void) 0)
 #define trace_xfs_agf(a,b,c,d)                 ((void) 0)
 #define trace_xfs_read_agf(a,b)                        ((void) 0)
 #define trace_xfs_alloc_read_agf(a,b)          ((void) 0)
index 2b48ed14d67bcb8d16c50ab23e5c6c9c4bf948b3..d5e075362ababe5b852bc5c7cb1cd6584b7a3703 100644 (file)
@@ -181,8 +181,8 @@ xfs_agfl_free_finish_item(
 
        error = xfs_alloc_read_agf(xefi->xefi_pag, tp, 0, &agbp);
        if (!error)
-               error = xfs_free_ag_extent(tp, agbp, xefi->xefi_pag->pag_agno,
-                               agbno, 1, &oinfo, XFS_AG_RESV_AGFL);
+               error = xfs_free_ag_extent(tp, agbp, agbno, 1, &oinfo,
+                               XFS_AG_RESV_AGFL);
 
        xfs_extent_free_cancel_item(item);
        return error;
index 355f8ef1a872d34dc8b0504907c69904e0df72fd..1f4740cced73a1e522deeb5909d83ad3bb9731a6 100644 (file)
@@ -2033,7 +2033,6 @@ int
 xfs_free_ag_extent(
        struct xfs_trans                *tp,
        struct xfs_buf                  *agbp,
-       xfs_agnumber_t                  agno,
        xfs_agblock_t                   bno,
        xfs_extlen_t                    len,
        const struct xfs_owner_info     *oinfo,
@@ -2354,19 +2353,19 @@ xfs_free_ag_extent(
         * Update the freespace totals in the ag and superblock.
         */
        error = xfs_alloc_update_counters(tp, agbp, len);
-       xfs_ag_resv_free_extent(agbp->b_pag, type, tp, len);
+       xfs_ag_resv_free_extent(pag, type, tp, len);
        if (error)
                goto error0;
 
        XFS_STATS_INC(mp, xs_freex);
        XFS_STATS_ADD(mp, xs_freeb, len);
 
-       trace_xfs_free_extent(mp, agno, bno, len, type, haveleft, haveright);
+       trace_xfs_free_extent(pag, bno, len, type, haveleft, haveright);
 
        return 0;
 
  error0:
-       trace_xfs_free_extent(mp, agno, bno, len, type, -1, -1);
+       trace_xfs_free_extent(pag, bno, len, type, -1, -1);
        if (bno_cur)
                xfs_btree_del_cursor(bno_cur, XFS_BTREE_ERROR);
        if (cnt_cur)
@@ -4006,8 +4005,7 @@ __xfs_free_extent(
                goto err_release;
        }
 
-       error = xfs_free_ag_extent(tp, agbp, pag->pag_agno, agbno, len, oinfo,
-                       type);
+       error = xfs_free_ag_extent(tp, agbp, agbno, len, oinfo, type);
        if (error)
                goto err_release;
 
index 0165452e7cd05593e60450fdcc59dd0cb9287422..88fbce5001185f8e920d6e696360a9d105e2fd21 100644 (file)
@@ -79,9 +79,8 @@ int xfs_alloc_put_freelist(struct xfs_perag *pag, struct xfs_trans *tp,
                struct xfs_buf *agfbp, struct xfs_buf *agflbp,
                xfs_agblock_t bno, int btreeblk);
 int xfs_free_ag_extent(struct xfs_trans *tp, struct xfs_buf *agbp,
-               xfs_agnumber_t agno, xfs_agblock_t bno,
-               xfs_extlen_t len, const struct xfs_owner_info *oinfo,
-               enum xfs_ag_resv_type type);
+               xfs_agblock_t bno, xfs_extlen_t len,
+               const struct xfs_owner_info *oinfo, enum xfs_ag_resv_type type);
 
 /*
  * Compute and fill in value of m_alloc_maxlevels.