summaryrefslogtreecommitdiff
path: root/fs/xfs/xfs_rtalloc.c
diff options
context:
space:
mode:
authorDarrick J. Wong <djwong@kernel.org>2023-10-16 19:44:13 +0300
committerDarrick J. Wong <djwong@kernel.org>2023-10-18 02:26:25 +0300
commit90d98a6ada1da0f8797ff3f5adafd175dd8c0a81 (patch)
treeeb049ef082910ac663b2be0ed7794a59d7723b58 /fs/xfs/xfs_rtalloc.c
parentef5a83b7e597038d1c734ddb4bc00638082c2bf1 (diff)
downloadlinux-90d98a6ada1da0f8797ff3f5adafd175dd8c0a81.tar.xz
xfs: convert the rtbitmap block and bit macros to static inline functions
Replace these macros with typechecked helper functions. Eventually we're going to add more logic to the helpers and it'll be easier if we don't have to macro it up. 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.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/fs/xfs/xfs_rtalloc.c b/fs/xfs/xfs_rtalloc.c
index e5a3200cea72..fdfb22baa6da 100644
--- a/fs/xfs/xfs_rtalloc.c
+++ b/fs/xfs/xfs_rtalloc.c
@@ -177,7 +177,7 @@ xfs_rtallocate_range(
*/
error = xfs_rtmodify_summary(mp, tp,
XFS_RTBLOCKLOG(postblock + 1 - preblock),
- XFS_BITTOBLOCK(mp, preblock), -1, rbpp, rsb);
+ xfs_rtx_to_rbmblock(mp, preblock), -1, rbpp, rsb);
if (error) {
return error;
}
@@ -188,7 +188,7 @@ xfs_rtallocate_range(
if (preblock < start) {
error = xfs_rtmodify_summary(mp, tp,
XFS_RTBLOCKLOG(start - preblock),
- XFS_BITTOBLOCK(mp, preblock), 1, rbpp, rsb);
+ xfs_rtx_to_rbmblock(mp, preblock), 1, rbpp, rsb);
if (error) {
return error;
}
@@ -200,7 +200,7 @@ xfs_rtallocate_range(
if (postblock > end) {
error = xfs_rtmodify_summary(mp, tp,
XFS_RTBLOCKLOG(postblock - end),
- XFS_BITTOBLOCK(mp, end + 1), 1, rbpp, rsb);
+ xfs_rtx_to_rbmblock(mp, end + 1), 1, rbpp, rsb);
if (error) {
return error;
}
@@ -261,8 +261,8 @@ xfs_rtallocate_extent_block(
* Loop over all the extents starting in this bitmap block,
* looking for one that's long enough.
*/
- for (i = XFS_BLOCKTOBIT(mp, bbno), besti = -1, bestlen = 0,
- end = XFS_BLOCKTOBIT(mp, bbno + 1) - 1;
+ for (i = xfs_rbmblock_to_rtx(mp, bbno), besti = -1, bestlen = 0,
+ end = xfs_rbmblock_to_rtx(mp, bbno + 1) - 1;
i <= end;
i++) {
/* Make sure we don't scan off the end of the rt volume. */
@@ -489,7 +489,7 @@ xfs_rtallocate_extent_near(
*rtx = r;
return 0;
}
- bbno = XFS_BITTOBLOCK(mp, start);
+ bbno = xfs_rtx_to_rbmblock(mp, start);
i = 0;
ASSERT(minlen != 0);
log2len = xfs_highbit32(minlen);
@@ -708,8 +708,8 @@ xfs_rtallocate_extent_size(
* allocator is beyond the next bitmap block,
* skip to that bitmap block.
*/
- if (XFS_BITTOBLOCK(mp, n) > i + 1)
- i = XFS_BITTOBLOCK(mp, n) - 1;
+ if (xfs_rtx_to_rbmblock(mp, n) > i + 1)
+ i = xfs_rtx_to_rbmblock(mp, n) - 1;
}
}
/*
@@ -771,8 +771,8 @@ xfs_rtallocate_extent_size(
* allocator is beyond the next bitmap block,
* skip to that bitmap block.
*/
- if (XFS_BITTOBLOCK(mp, n) > i + 1)
- i = XFS_BITTOBLOCK(mp, n) - 1;
+ if (xfs_rtx_to_rbmblock(mp, n) > i + 1)
+ i = xfs_rtx_to_rbmblock(mp, n) - 1;
}
}
/*