summaryrefslogtreecommitdiff
path: root/fs/xfs/xfs_rtalloc.c
diff options
context:
space:
mode:
authorDarrick J. Wong <djwong@kernel.org>2022-08-17 15:40:36 -0700
committerDarrick J. Wong <djwong@kernel.org>2022-10-14 14:17:06 -0700
commit278a1061c3579f2fe502acd801ed0a8f0b3a9eee (patch)
treefd6a10fbd5dd5a2b27e7fd7960a23e425efb6a0d /fs/xfs/xfs_rtalloc.c
parentf4c3d7d5f43f9e5490c890c8da6eb6cddb0901cf (diff)
xfs: create helpers to convert rt block numbers to rt extent numbers
Create helpers to do unit conversions of rt block numbers to rt extent numbers. There are two variations -- the suffix "t" denotes the one that returns only the truncated extent number; the other one also returns the misalignment. Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Diffstat (limited to 'fs/xfs/xfs_rtalloc.c')
-rw-r--r--fs/xfs/xfs_rtalloc.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/fs/xfs/xfs_rtalloc.c b/fs/xfs/xfs_rtalloc.c
index 40b6df0ad633..04a468f4cb8a 100644
--- a/fs/xfs/xfs_rtalloc.c
+++ b/fs/xfs/xfs_rtalloc.c
@@ -1494,16 +1494,16 @@ xfs_rtfile_want_conversion(
struct xfs_bmbt_irec *irec)
{
xfs_fileoff_t rext_next;
- uint32_t modoff, modcnt;
+ xfs_extlen_t modoff, modcnt;
if (irec->br_state != XFS_EXT_UNWRITTEN)
return false;
- div_u64_rem(irec->br_startoff, mp->m_sb.sb_rextsize, &modoff);
+ xfs_rtb_to_rtx(mp, irec->br_startoff, &modoff);
if (modoff == 0) {
- uint64_t rexts = div_u64_rem(irec->br_blockcount,
- mp->m_sb.sb_rextsize, &modcnt);
+ xfs_rtbxlen_t rexts;
+ rexts = xfs_rtb_to_rtx(mp, irec->br_blockcount, &modcnt);
if (rexts > 0) {
/*
* Unwritten mapping starts at an rt extent boundary