]> www.infradead.org Git - users/hch/xfsprogs.git/commitdiff
xfs_repair: stop using libxfs_rt{bitmap,summary}_wordcount
authorChristoph Hellwig <hch@lst.de>
Mon, 5 Aug 2024 13:50:59 +0000 (15:50 +0200)
committerChristoph Hellwig <hch@lst.de>
Mon, 5 Aug 2024 18:52:43 +0000 (11:52 -0700)
We can easily calculate the values by just shifting the mount/sb based
sized without the need of these helpers.

Signed-off-by: Christoph Hellwig <hch@lst.de>
repair/rt.c

index 15fa7de1f10bd26903122923db9849668fbdb774..f52012a8cc61a14922e6258cf11ec33825b2e858 100644 (file)
@@ -53,17 +53,18 @@ generate_rtinfo(
        int                     bmbno = 0;
        int                     start_bmbno = 0;
        bool                    in_extent = false;
+       unsigned long long      wordcnt;
        union xfs_rtword_raw    *words;
 
-       btmcompute = calloc(libxfs_rtbitmap_wordcount(mp, mp->m_sb.sb_rextents),
-                       sizeof(union xfs_rtword_raw));
+       wordcnt = XFS_FSB_TO_B(mp, mp->m_sb.sb_rbmblocks) >> XFS_WORDLOG;
+       btmcompute = calloc(wordcnt, sizeof(union xfs_rtword_raw));
        if (!btmcompute)
                do_error(
 _("couldn't allocate memory for incore realtime bitmap.\n"));
        words = btmcompute;
 
-       sumcompute = calloc(libxfs_rtsummary_wordcount(mp, mp->m_rsumlevels,
-                       mp->m_sb.sb_rbmblocks), sizeof(union xfs_suminfo_raw));
+       wordcnt = mp->m_rsumsize >> XFS_WORDLOG;
+       sumcompute = calloc(wordcnt, sizeof(union xfs_suminfo_raw));
        if (!sumcompute)
                do_error(
 _("couldn't allocate memory for incore realtime summary info.\n"));