summaryrefslogtreecommitdiff
path: root/fs/xfs/xfs_fsmap.c
diff options
context:
space:
mode:
authorDarrick J. Wong <djwong@kernel.org>2022-08-17 15:51:25 -0700
committerDarrick J. Wong <djwong@kernel.org>2022-10-14 14:17:07 -0700
commit7af9445c2ae2ca24cf7cc1a4a2c6b73e354fc6b2 (patch)
treee389859a5d384f554f482f6c66a346e8b386c43c /fs/xfs/xfs_fsmap.c
parent278a1061c3579f2fe502acd801ed0a8f0b3a9eee (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>
Diffstat (limited to 'fs/xfs/xfs_fsmap.c')
-rw-r--r--fs/xfs/xfs_fsmap.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/fs/xfs/xfs_fsmap.c b/fs/xfs/xfs_fsmap.c
index 3738dc936d85..8d0a6f480d2a 100644
--- a/fs/xfs/xfs_fsmap.c
+++ b/fs/xfs/xfs_fsmap.c
@@ -522,6 +522,7 @@ xfs_getfsmap_rtdev_rtbitmap_query(
struct xfs_rtalloc_rec alow = { 0 };
struct xfs_rtalloc_rec ahigh = { 0 };
struct xfs_mount *mp = tp->t_mountp;
+ unsigned int mod;
int error;
xfs_ilock(mp->m_rbmip, XFS_ILOCK_SHARED | XFS_ILOCK_RTBITMAP);
@@ -530,10 +531,9 @@ xfs_getfsmap_rtdev_rtbitmap_query(
* Set up query parameters to return free rtextents covering the range
* we want.
*/
- alow.ar_startext = info->low.rm_startblock;
- ahigh.ar_startext = info->high.rm_startblock;
- do_div(alow.ar_startext, mp->m_sb.sb_rextsize);
- if (do_div(ahigh.ar_startext, mp->m_sb.sb_rextsize))
+ alow.ar_startext = xfs_rtb_to_rtxt(mp, info->low.rm_startblock);
+ ahigh.ar_startext = xfs_rtb_to_rtx(mp, info->high.rm_startblock, &mod);
+ if (mod)
ahigh.ar_startext++;
error = xfs_rtalloc_query_range(mp, tp, &alow, &ahigh,
xfs_getfsmap_rtdev_rtbitmap_helper, info);