xfs: pass a pag to xfs_extent_busy_{search,reuse}

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>
This commit is contained in:
Christoph Hellwig 2024-11-03 20:18:29 -08:00 committed by Darrick J. Wong
parent 6abd82ab6e
commit b6dc8c6dd2
6 changed files with 13 additions and 17 deletions

View 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));
}

View 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);

View 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);

View 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;
}

View 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;
}

View 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,