]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
xfs: pass a pag to xfs_extent_busy_{search,reuse}
authorChristoph Hellwig <hch@lst.de>
Mon, 4 Nov 2024 04:18:29 +0000 (20:18 -0800)
committerDarrick J. Wong <djwong@kernel.org>
Tue, 5 Nov 2024 21:38:25 +0000 (13:38 -0800)
Replace the [mp,agno] tuple with the perag structure, which will become
more useful later.

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>
fs/xfs/libxfs/xfs_alloc.c
fs/xfs/libxfs/xfs_alloc_btree.c
fs/xfs/libxfs/xfs_rmap_btree.c
fs/xfs/xfs_discard.c
fs/xfs/xfs_extent_busy.c
fs/xfs/xfs_extent_busy.h

index 847a028a6206fca22dfd949ecd6a65ac5783d9cd..6970a47bea1bd226070c4a7ffbe31a399e3baf1e 100644 (file)
@@ -1252,7 +1252,7 @@ xfs_alloc_ag_vextent_small(
        if (fbno == NULLAGBLOCK)
                goto out;
 
-       xfs_extent_busy_reuse(args->mp, args->pag, fbno, 1,
+       xfs_extent_busy_reuse(args->pag, fbno, 1,
                              (args->datatype & XFS_ALLOC_NOBUSY));
 
        if (args->datatype & XFS_ALLOC_USERDATA) {
@@ -3616,7 +3616,7 @@ xfs_alloc_vextent_finish(
                if (error)
                        goto out_drop_perag;
 
-               ASSERT(!xfs_extent_busy_search(mp, args->pag, args->agbno,
+               ASSERT(!xfs_extent_busy_search(args->pag, args->agbno,
                                args->len));
        }
 
index aada676eee519cc9875862d2847d5d932d948b63..5175d0b4d32e485ed037f13d616d6e61a3c26d88 100644 (file)
@@ -86,7 +86,7 @@ xfs_allocbt_alloc_block(
        }
 
        atomic64_inc(&cur->bc_mp->m_allocbt_blks);
-       xfs_extent_busy_reuse(cur->bc_mp, cur->bc_ag.pag, bno, 1, false);
+       xfs_extent_busy_reuse(cur->bc_ag.pag, bno, 1, false);
 
        new->s = cpu_to_be32(bno);
 
index ac2f1f499b76f6977942c9dd3ee88ca3056ef9a5..b49006c1ca7eeeeb7737fc8f326473c171e69aed 100644 (file)
@@ -102,7 +102,7 @@ xfs_rmapbt_alloc_block(
                return 0;
        }
 
-       xfs_extent_busy_reuse(cur->bc_mp, pag, bno, 1, false);
+       xfs_extent_busy_reuse(pag, bno, 1, false);
 
        new->s = cpu_to_be32(bno);
        be32_add_cpu(&agf->agf_rmap_blocks, 1);
index d8c4a5dcca7aea34daad4dd5381d689b4a73238d..1a91e97d25ffba1e5399576d6fa0b3e2484e82eb 100644 (file)
@@ -272,7 +272,7 @@ xfs_trim_gather_extents(
                 * If any blocks in the range are still busy, skip the
                 * discard and try again the next time.
                 */
-               if (xfs_extent_busy_search(mp, pag, fbno, flen)) {
+               if (xfs_extent_busy_search(pag, fbno, flen)) {
                        trace_xfs_discard_busy(mp, pag->pag_agno, fbno, flen);
                        goto next_extent;
                }
index a73e7c73b664c6bd5bafffb494c1a84924508ab1..22c16fa56bcc44471ef7fd7d9eb2d73e7c601da4 100644 (file)
@@ -101,7 +101,6 @@ xfs_extent_busy_insert_discard(
  */
 int
 xfs_extent_busy_search(
-       struct xfs_mount        *mp,
        struct xfs_perag        *pag,
        xfs_agblock_t           bno,
        xfs_extlen_t            len)
@@ -148,7 +147,6 @@ xfs_extent_busy_search(
  */
 STATIC bool
 xfs_extent_busy_update_extent(
-       struct xfs_mount        *mp,
        struct xfs_perag        *pag,
        struct xfs_extent_busy  *busyp,
        xfs_agblock_t           fbno,
@@ -280,24 +278,22 @@ xfs_extent_busy_update_extent(
                ASSERT(0);
        }
 
-       trace_xfs_extent_busy_reuse(mp, pag->pag_agno, fbno, flen);
+       trace_xfs_extent_busy_reuse(pag->pag_mount, pag->pag_agno, fbno, flen);
        return true;
 
 out_force_log:
        spin_unlock(&pag->pagb_lock);
-       xfs_log_force(mp, XFS_LOG_SYNC);
-       trace_xfs_extent_busy_force(mp, pag->pag_agno, fbno, flen);
+       xfs_log_force(pag->pag_mount, XFS_LOG_SYNC);
+       trace_xfs_extent_busy_force(pag->pag_mount, pag->pag_agno, fbno, flen);
        spin_lock(&pag->pagb_lock);
        return false;
 }
 
-
 /*
  * For a given extent [fbno, flen], make sure we can reuse it safely.
  */
 void
 xfs_extent_busy_reuse(
-       struct xfs_mount        *mp,
        struct xfs_perag        *pag,
        xfs_agblock_t           fbno,
        xfs_extlen_t            flen,
@@ -323,7 +319,7 @@ restart:
                        continue;
                }
 
-               if (!xfs_extent_busy_update_extent(mp, pag, busyp, fbno, flen,
+               if (!xfs_extent_busy_update_extent(pag, busyp, fbno, flen,
                                                  userdata))
                        goto restart;
        }
index 470032de31391b10245e93ec8f018c1f226f85c3..847c904a19386c6d664b620c5523432ea38a27c9 100644 (file)
@@ -58,12 +58,12 @@ xfs_extent_busy_clear(struct xfs_mount *mp, struct list_head *list,
        bool do_discard);
 
 int
-xfs_extent_busy_search(struct xfs_mount *mp, struct xfs_perag *pag,
-       xfs_agblock_t bno, xfs_extlen_t len);
+xfs_extent_busy_search(struct xfs_perag *pag, xfs_agblock_t bno,
+               xfs_extlen_t len);
 
 void
-xfs_extent_busy_reuse(struct xfs_mount *mp, struct xfs_perag *pag,
-       xfs_agblock_t fbno, xfs_extlen_t flen, bool userdata);
+xfs_extent_busy_reuse(struct xfs_perag *pag, xfs_agblock_t fbno,
+               xfs_extlen_t flen, bool userdata);
 
 bool
 xfs_extent_busy_trim(struct xfs_alloc_arg *args, xfs_agblock_t *bno,