@@ -135,13 +135,22 @@ xfs_rtb_roundup_rtx(
return roundup_64(rtbno, mp->m_sb.sb_rextsize);
}
-/* Round this rtblock down to the nearest rt extent size. */
+/* Round this file block offset up to the nearest rt extent size. */
static inline xfs_rtblock_t
-xfs_rtb_rounddown_rtx(
+xfs_fileoff_roundup_rtx(
struct xfs_mount *mp,
- xfs_rtblock_t rtbno)
+ xfs_fileoff_t off)
{
- return rounddown_64(rtbno, mp->m_sb.sb_rextsize);
+ return roundup_64(off, mp->m_sb.sb_rextsize);
+}
+
+/* Round this file block offset down to the nearest rt extent size. */
+static inline xfs_rtblock_t
+xfs_fileoff_rounddown_rtx(
+ struct xfs_mount *mp,
+ xfs_fileoff_t off)
+{
+ return rounddown_64(off, mp->m_sb.sb_rextsize);
}
/* Convert an rt extent number to a file block offset in the rt bitmap file. */
@@ -197,7 +197,7 @@ process_rt_rec_dups(
xfs_rtblock_t b;
xfs_rtxnum_t ext;
- for (b = xfs_rtb_rounddown_rtx(mp, irec->br_startblock);
+ for (b = irec->br_startblock;
b < irec->br_startblock + irec->br_blockcount;
b += mp->m_sb.sb_rextsize) {
ext = xfs_rtb_to_rtx(mp, b);
@@ -245,7 +245,7 @@ process_rt_rec_state(
do_error(
_("data fork in rt inode %" PRIu64 " found invalid rt extent %"PRIu64" state %d at rt block %"PRIu64"\n"),
ino, ext, state, b);
- b = xfs_rtb_roundup_rtx(mp, b);
+ b += mp->m_sb.sb_rextsize - mod;
continue;
}