summaryrefslogtreecommitdiffstats
path: root/fs/xfs/xfs_rtalloc.c
diff options
context:
space:
mode:
authorDarrick J. Wong <djwong@kernel.org>2023-10-16 09:37:47 -0700
committerDarrick J. Wong <djwong@kernel.org>2023-10-17 16:25:55 -0700
commit055641248f649b52620a5fe8774bea253690e057 (patch)
treef3079426c34852056cdb7b96435560e0188288eb /fs/xfs/xfs_rtalloc.c
parent5dc3a80d46a450481df7f7e9fe673ba3eb4514c3 (diff)
downloadlinux-stable-055641248f649b52620a5fe8774bea253690e057.tar.gz
linux-stable-055641248f649b52620a5fe8774bea253690e057.tar.bz2
linux-stable-055641248f649b52620a5fe8774bea253690e057.zip
xfs: convert do_div calls to xfs_rtb_to_rtx helper calls
Convert these calls to use the helpers, and clean up all these places where the same variable can have different units depending on where it is in the function. Signed-off-by: Darrick J. Wong <djwong@kernel.org> Reviewed-by: Christoph Hellwig <hch@lst.de>
Diffstat (limited to 'fs/xfs/xfs_rtalloc.c')
-rw-r--r--fs/xfs/xfs_rtalloc.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/fs/xfs/xfs_rtalloc.c b/fs/xfs/xfs_rtalloc.c
index 62faec195040..ac7c269ad547 100644
--- a/fs/xfs/xfs_rtalloc.c
+++ b/fs/xfs/xfs_rtalloc.c
@@ -1058,8 +1058,7 @@ xfs_growfs_rt(
nrblocks_step = (bmbno + 1) * NBBY * nsbp->sb_blocksize *
nsbp->sb_rextsize;
nsbp->sb_rblocks = min(nrblocks, nrblocks_step);
- nsbp->sb_rextents = nsbp->sb_rblocks;
- do_div(nsbp->sb_rextents, nsbp->sb_rextsize);
+ nsbp->sb_rextents = xfs_rtb_to_rtx(nmp, nsbp->sb_rblocks);
ASSERT(nsbp->sb_rextents != 0);
nsbp->sb_rextslog = xfs_highbit32(nsbp->sb_rextents);
nrsumlevels = nmp->m_rsumlevels = nsbp->sb_rextslog + 1;