]> www.infradead.org Git - users/hch/xfs.git/commitdiff
xfs: remove __xfs_rtb_to_rgbno
authorChristoph Hellwig <hch@lst.de>
Tue, 1 Oct 2024 11:47:44 +0000 (13:47 +0200)
committerChristoph Hellwig <hch@lst.de>
Wed, 2 Oct 2024 07:16:01 +0000 (09:16 +0200)
Now that we have a generic mask field that has the right value for
legacy file systems, the caller can triviall open code the masking.

Signed-off-by: Christoph Hellwig <hch@lst.de>
fs/xfs/libxfs/xfs_rtbitmap.h
fs/xfs/libxfs/xfs_rtgroup.h

index 821f388b619c067e680883ea1c469e335753533a..f569760fb595ee07962e76865fc34418e787f1f8 100644 (file)
@@ -128,11 +128,10 @@ xfs_rtb_to_rtx(
        struct xfs_mount        *mp,
        xfs_rtblock_t           rtbno)
 {
-       uint64_t                __rgbno = __xfs_rtb_to_rgbno(mp, rtbno);
-
+       rtbno &= mp->m_groups[XG_TYPE_RTG].blkmask;
        if (likely(mp->m_rtxblklog >= 0))
-               return __rgbno >> mp->m_rtxblklog;
-       return div_u64(__rgbno, mp->m_sb.sb_rextsize);
+               return rtbno >> mp->m_rtxblklog;
+       return div_u64(rtbno, mp->m_sb.sb_rextsize);
 }
 
 /* Return the offset of a rtgroup block number within an rt extent. */
@@ -150,12 +149,10 @@ xfs_rtb_to_rtxoff(
        struct xfs_mount        *mp,
        xfs_rtblock_t           rtbno)
 {
-       uint64_t                __rgbno = __xfs_rtb_to_rgbno(mp, rtbno);
-
+       rtbno &= mp->m_groups[XG_TYPE_RTG].blkmask;
        if (likely(mp->m_rtxblklog >= 0))
-               return __rgbno & mp->m_rtxblkmask;
-
-       return do_div(__rgbno, mp->m_sb.sb_rextsize);
+               return rtbno & mp->m_rtxblkmask;
+       return do_div(rtbno, mp->m_sb.sb_rextsize);
 }
 
 /* Round this rtblock up to the nearest rt extent size. */
index e2793ac012dd80a14a0345e803aa1cf5aa7a6411..246228ecd359efb56d6d09a60cd8e96cc99a3126 100644 (file)
@@ -188,17 +188,6 @@ xfs_rtb_to_rgno(
        return xfs_fsb_to_gno(mp, rtbno, XG_TYPE_RTG);
 }
 
-static inline uint64_t
-__xfs_rtb_to_rgbno(
-       struct xfs_mount        *mp,
-       xfs_rtblock_t           rtbno)
-{
-       if (!xfs_has_rtgroups(mp))
-               return rtbno;
-
-       return rtbno & mp->m_groups[XG_TYPE_RTG].blkmask;
-}
-
 static inline xfs_rgblock_t
 xfs_rtb_to_rgbno(
        struct xfs_mount        *mp,
@@ -229,7 +218,7 @@ xfs_rtb_to_daddr(
        xfs_rtblock_t           rtbno)
 {
        return xfs_rgbno_to_daddr(mp, xfs_rtb_to_rgno(mp, rtbno),
-                                   __xfs_rtb_to_rgbno(mp, rtbno));
+                       rtbno & mp->m_groups[XG_TYPE_RTG].blkmask);
 }
 
 static inline xfs_rgnumber_t