summaryrefslogtreecommitdiff
path: root/fs/xfs/xfs_bmap_util.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_bmap_util.c
parent5dc3a80d46a450481df7f7e9fe673ba3eb4514c3 (diff)
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_bmap_util.c')
-rw-r--r--fs/xfs/xfs_bmap_util.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/fs/xfs/xfs_bmap_util.c b/fs/xfs/xfs_bmap_util.c
index 4f53f784f06d..25a03c1276e3 100644
--- a/fs/xfs/xfs_bmap_util.c
+++ b/fs/xfs/xfs_bmap_util.c
@@ -156,14 +156,12 @@ retry:
* Realtime allocation, done through xfs_rtallocate_extent.
*/
if (ignore_locality)
- ap->blkno = 0;
+ rtx = 0;
else
- do_div(ap->blkno, mp->m_sb.sb_rextsize);
- rtx = ap->blkno;
- ap->length = ralen;
+ rtx = xfs_rtb_to_rtx(mp, ap->blkno);
raminlen = max_t(xfs_rtxlen_t, 1, xfs_extlen_to_rtxlen(mp, minlen));
- error = xfs_rtallocate_extent(ap->tp, ap->blkno, raminlen, ap->length,
- &ralen, ap->wasdel, prod, &rtx);
+ error = xfs_rtallocate_extent(ap->tp, rtx, raminlen, ralen, &ralen,
+ ap->wasdel, prod, &rtx);
if (error)
return error;