From 934b3fec24690387ae63b427421910c54dd41c9f Mon Sep 17 00:00:00 2001 From: Christoph Hellwig Date: Mon, 5 Aug 2024 15:50:59 +0200 Subject: [PATCH] xfs_repair: stop using libxfs_rt{bitmap,summary}_wordcount 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 --- repair/rt.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/repair/rt.c b/repair/rt.c index 15fa7de1f..f52012a8c 100644 --- a/repair/rt.c +++ b/repair/rt.c @@ -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")); -- 2.50.1