]> git.ipfire.org Git - people/ms/linux.git/blobdiff - fs/xfs/libxfs/xfs_refcount_btree.c
Merge branch 'for-6.0/dax' into libnvdimm-fixes
[people/ms/linux.git] / fs / xfs / libxfs / xfs_refcount_btree.c
index d14c1720b0fb351bfbbcfeccb682a623d0760cbd..316c1ec0c3c26d31e243cd3174293826dfe61a89 100644 (file)
@@ -493,7 +493,7 @@ xfs_refcountbt_calc_reserves(
        if (!xfs_has_reflink(mp))
                return 0;
 
-       error = xfs_alloc_read_agf(mp, tp, pag->pag_agno, 0, &agbp);
+       error = xfs_alloc_read_agf(pag, tp, 0, &agbp);
        if (error)
                return error;
 
@@ -507,8 +507,7 @@ xfs_refcountbt_calc_reserves(
         * never be available for the kinds of things that would require btree
         * expansion.  We therefore can pretend the space isn't there.
         */
-       if (mp->m_sb.sb_logstart &&
-           XFS_FSB_TO_AGNO(mp, mp->m_sb.sb_logstart) == pag->pag_agno)
+       if (xfs_ag_contains_log(mp, pag->pag_agno))
                agblocks -= mp->m_sb.sb_logblocks;
 
        *ask += xfs_refcountbt_max_size(mp, agblocks);