]> www.infradead.org Git - users/hch/xfs.git/commitdiff
xfs: remove the agno argument to xfs_free_ag_extent
authorChristoph Hellwig <hch@lst.de>
Sat, 31 Aug 2024 08:18:02 +0000 (11:18 +0300)
committerChristoph Hellwig <hch@lst.de>
Fri, 20 Sep 2024 12:06:47 +0000 (14:06 +0200)
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>
fs/xfs/libxfs/xfs_alloc.c
fs/xfs/libxfs/xfs_alloc.h
fs/xfs/xfs_extfree_item.c
fs/xfs/xfs_trace.h

index 59326f84f6a571581edf6074003a48a20cba0f76..fcfb03abbe16a2a8f2461492e9b41ac8802b226a 100644 (file)
@@ -2037,7 +2037,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,
@@ -2358,19 +2357,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)
@@ -4015,8 +4014,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 fae170825be06463b93d616fc9178f11cf533776..90a7fd597620927f35f9b6c2213b2f6d09d79af2 100644 (file)
@@ -81,9 +81,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.
index abffc74a924f77445d2573628e5c836622ee4ff6..7f1be08dbc1123dc1ad10b6ac916e5f6e2b1ef79 100644 (file)
@@ -547,8 +547,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_efd_add_extent(efdp, xefi);
        xfs_extent_free_cancel_item(&xefi->xefi_list);
index ee9f0b1f548dc1ef6de47db50e7740f67b20744a..3d29329db0dfbd5500e2df0231ab9db6b6983df9 100644 (file)
@@ -1763,10 +1763,9 @@ DEFINE_AGF_EVENT(xfs_agf);
 DEFINE_AGF_EVENT(xfs_agfl_reset);
 
 TRACE_EVENT(xfs_free_extent,
-       TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, xfs_agblock_t agbno,
-                xfs_extlen_t len, enum xfs_ag_resv_type resv, int haveleft,
-                int haveright),
-       TP_ARGS(mp, agno, agbno, len, resv, haveleft, haveright),
+       TP_PROTO(struct xfs_perag *pag, xfs_agblock_t agbno, xfs_extlen_t len,
+                enum xfs_ag_resv_type resv, int haveleft, int haveright),
+       TP_ARGS(pag, agbno, len, resv, haveleft, haveright),
        TP_STRUCT__entry(
                __field(dev_t, dev)
                __field(xfs_agnumber_t, agno)
@@ -1777,8 +1776,8 @@ TRACE_EVENT(xfs_free_extent,
                __field(int, haveright)
        ),
        TP_fast_assign(
-               __entry->dev = mp->m_super->s_dev;
-               __entry->agno = agno;
+               __entry->dev = pag->pag_mount->m_super->s_dev;
+               __entry->agno = pag->pag_agno;
                __entry->agbno = agbno;
                __entry->len = len;
                __entry->resv = resv;