]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commitdiff
xfs: remove xfs_{rtbitmap,rtsummary}_wordcount
authorChristoph Hellwig <hch@lst.de>
Mon, 21 Oct 2024 00:10:43 +0000 (17:10 -0700)
committerDarrick J. Wong <djwong@kernel.org>
Thu, 31 Oct 2024 22:45:02 +0000 (15:45 -0700)
Source kernel commit: 1fc51cf11dd8b26856ae1c4111e402caec73019c

xfs_rtbitmap_wordcount and xfs_rtsummary_wordcount are currently unused,
so remove them to simplify refactoring other rtbitmap helpers.  They
can be added back or simply open coded when actually needed.

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>
db/check.c
libxfs/xfs_rtbitmap.c
libxfs/xfs_rtbitmap.h
repair/rt.c

index bceaf318d75ed8a7dcaa9b5f25e45a768df197a8..00ef3c1d4b508c4ac9b1790d5eb5b0e7715b3407 100644 (file)
@@ -1958,8 +1958,7 @@ init(
 
                dbmap[c] = xcalloc(mp->m_sb.sb_rblocks, sizeof(**dbmap));
                inomap[c] = xcalloc(mp->m_sb.sb_rblocks, sizeof(**inomap));
-               words = libxfs_rtsummary_wordcount(mp, mp->m_rsumlevels,
-                               mp->m_sb.sb_rbmblocks);
+               words = mp->m_rsumsize >> XFS_WORDLOG;
                sumfile = xcalloc(words, sizeof(union xfs_suminfo_raw));
                sumcompute = xcalloc(words, sizeof(union xfs_suminfo_raw));
        }
index 3f534a4724a26b955ae6dc4c8db4c3c374bdf99b..1c657da907132ea9e9757f7c47dcdfefaf520b8b 100644 (file)
@@ -1146,21 +1146,6 @@ xfs_rtbitmap_blockcount(
        return howmany_64(rtextents, NBBY * mp->m_sb.sb_blocksize);
 }
 
-/*
- * Compute the number of rtbitmap words needed to populate every block of a
- * bitmap that is large enough to track the given number of rt extents.
- */
-unsigned long long
-xfs_rtbitmap_wordcount(
-       struct xfs_mount        *mp,
-       xfs_rtbxlen_t           rtextents)
-{
-       xfs_filblks_t           blocks;
-
-       blocks = xfs_rtbitmap_blockcount(mp, rtextents);
-       return XFS_FSB_TO_B(mp, blocks) >> XFS_WORDLOG;
-}
-
 /* Compute the number of rtsummary blocks needed to track the given rt space. */
 xfs_filblks_t
 xfs_rtsummary_blockcount(
@@ -1174,22 +1159,6 @@ xfs_rtsummary_blockcount(
        return XFS_B_TO_FSB(mp, rsumwords << XFS_WORDLOG);
 }
 
-/*
- * Compute the number of rtsummary info words needed to populate every block of
- * a summary file that is large enough to track the given rt space.
- */
-unsigned long long
-xfs_rtsummary_wordcount(
-       struct xfs_mount        *mp,
-       unsigned int            rsumlevels,
-       xfs_extlen_t            rbmblocks)
-{
-       xfs_filblks_t           blocks;
-
-       blocks = xfs_rtsummary_blockcount(mp, rsumlevels, rbmblocks);
-       return XFS_FSB_TO_B(mp, blocks) >> XFS_WORDLOG;
-}
-
 /* Lock both realtime free space metadata inodes for a freespace update. */
 void
 xfs_rtbitmap_lock(
index 0dbc9bb40668a2c5311bef0e445de3fd0aa02fc9..140513d1d6bcf1d5a13080b623c9a8e3fa98a932 100644 (file)
@@ -316,13 +316,8 @@ int xfs_rtfree_blocks(struct xfs_trans *tp, xfs_fsblock_t rtbno,
 
 xfs_filblks_t xfs_rtbitmap_blockcount(struct xfs_mount *mp, xfs_rtbxlen_t
                rtextents);
-unsigned long long xfs_rtbitmap_wordcount(struct xfs_mount *mp,
-               xfs_rtbxlen_t rtextents);
-
 xfs_filblks_t xfs_rtsummary_blockcount(struct xfs_mount *mp,
                unsigned int rsumlevels, xfs_extlen_t rbmblocks);
-unsigned long long xfs_rtsummary_wordcount(struct xfs_mount *mp,
-               unsigned int rsumlevels, xfs_extlen_t rbmblocks);
 
 int xfs_rtfile_initialize_blocks(struct xfs_inode *ip,
                xfs_fileoff_t offset_fsb, xfs_fileoff_t end_fsb, void *data);
@@ -355,9 +350,7 @@ xfs_rtbitmap_blockcount(struct xfs_mount *mp, xfs_rtbxlen_t rtextents)
        /* shut up gcc */
        return 0;
 }
-# define xfs_rtbitmap_wordcount(mp, r)                 (0)
 # define xfs_rtsummary_blockcount(mp, l, b)            (0)
-# define xfs_rtsummary_wordcount(mp, l, b)             (0)
 # define xfs_rtbitmap_lock(mp)                 do { } while (0)
 # define xfs_rtbitmap_trans_join(tp)           do { } while (0)
 # define xfs_rtbitmap_unlock(mp)               do { } while (0)
index 4c81e2114c7735553a6491b085e1dc1595ffc1eb..879946ab0b154e0a4f0a0f02cb7b71a560b08dc4 100644 (file)
@@ -27,14 +27,13 @@ rtinit(xfs_mount_t *mp)
         * information.  The rtbitmap buffer must be large enough to compare
         * against any unused bytes in the last block of the file.
         */
-       wordcnt = libxfs_rtbitmap_wordcount(mp, mp->m_sb.sb_rextents);
+       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"));
 
-       wordcnt = libxfs_rtsummary_wordcount(mp, mp->m_rsumlevels,
-                       mp->m_sb.sb_rbmblocks);
+       wordcnt = mp->m_rsumsize >> XFS_WORDLOG;
        sumcompute = calloc(wordcnt, sizeof(union xfs_suminfo_raw));
        if (!sumcompute)
                do_error(