return rtx * mp->m_sb.sb_rextsize;
}
-/*
- * Note: takes a uint64_t for bno because the rgbno component can overflow
- * xfs_rgblock_t on non-rtgroups file systems.
- */
-static inline xfs_daddr_t
-xfs_rgbno_to_daddr(
- struct xfs_mount *mp,
- xfs_rgnumber_t rgno,
- uint64_t rgbno)
-{
- uint64_t r = (xfs_rtblock_t)rgno *
- mp->m_groups[XG_TYPE_RTG].blocks;
-
- return XFS_FSB_TO_BB(mp, r + rgbno);
-}
-
static inline xfs_daddr_t
xfs_rtb_to_daddr(
struct xfs_mount *mp,
xfs_rtblock_t rtbno)
{
- return xfs_rgbno_to_daddr(mp, xfs_rtb_to_rgno(mp, rtbno),
- rtbno & mp->m_groups[XG_TYPE_RTG].blkmask);
+ struct xfs_groups *g = &mp->m_groups[XG_TYPE_RTG];
+ xfs_rgnumber_t rgno = xfs_rtb_to_rgno(mp, rtbno);
+ uint64_t start_bno = (xfs_rtblock_t)rgno * g->blocks;
+
+ return XFS_FSB_TO_BB(mp, start_bno + (rtbno & g->blkmask));
}
static inline xfs_rtblock_t