]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/blobdiff - libxfs/xfs_rmap_btree.c
xfs: pass transaction lock while setting up agresv on cyclic metadata
[thirdparty/xfsprogs-dev.git] / libxfs / xfs_rmap_btree.c
index bee158e58dc2359906801f6be04a1d6d04de6a65..cd81bbc22493e8d78fef3fff5eafb6ad2f706e57 100644 (file)
@@ -552,6 +552,7 @@ xfs_rmapbt_max_size(
 int
 xfs_rmapbt_calc_reserves(
        struct xfs_mount        *mp,
+       struct xfs_trans        *tp,
        xfs_agnumber_t          agno,
        xfs_extlen_t            *ask,
        xfs_extlen_t            *used)
@@ -565,14 +566,14 @@ xfs_rmapbt_calc_reserves(
        if (!xfs_sb_version_hasrmapbt(&mp->m_sb))
                return 0;
 
-       error = xfs_alloc_read_agf(mp, NULL, agno, 0, &agbp);
+       error = xfs_alloc_read_agf(mp, tp, agno, 0, &agbp);
        if (error)
                return error;
 
        agf = XFS_BUF_TO_AGF(agbp);
        agblocks = be32_to_cpu(agf->agf_length);
        tree_len = be32_to_cpu(agf->agf_rmap_blocks);
-       xfs_buf_relse(agbp);
+       xfs_trans_brelse(tp, agbp);
 
        /* Reserve 1% of the AG or enough for 1 block per record. */
        *ask += max(agblocks / 100, xfs_rmapbt_max_size(mp, agblocks));