From 8a5e35eb9e9618fde1a89b3a1f0ee60a5bf3c300 Mon Sep 17 00:00:00 2001 From: Christoph Hellwig Date: Tue, 1 Oct 2024 13:47:44 +0200 Subject: [PATCH] xfs: remove __xfs_rtb_to_rgbno 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 --- fs/xfs/libxfs/xfs_rtbitmap.h | 15 ++++++--------- fs/xfs/libxfs/xfs_rtgroup.h | 13 +------------ 2 files changed, 7 insertions(+), 21 deletions(-) diff --git a/fs/xfs/libxfs/xfs_rtbitmap.h b/fs/xfs/libxfs/xfs_rtbitmap.h index 821f388b619c..f569760fb595 100644 --- a/fs/xfs/libxfs/xfs_rtbitmap.h +++ b/fs/xfs/libxfs/xfs_rtbitmap.h @@ -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. */ diff --git a/fs/xfs/libxfs/xfs_rtgroup.h b/fs/xfs/libxfs/xfs_rtgroup.h index e2793ac012dd..246228ecd359 100644 --- a/fs/xfs/libxfs/xfs_rtgroup.h +++ b/fs/xfs/libxfs/xfs_rtgroup.h @@ -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 -- 2.50.1