aboutsummaryrefslogtreecommitdiffstats
path: root/fs/xfs/xfs_rtalloc.c
diff options
context:
space:
mode:
authorDarrick J. Wong <[email protected]>2023-10-16 16:44:13 +0000
committerDarrick J. Wong <[email protected]>2023-10-17 23:26:25 +0000
commit90d98a6ada1da0f8797ff3f5adafd175dd8c0a81 (patch)
treeeb049ef082910ac663b2be0ed7794a59d7723b58 /fs/xfs/xfs_rtalloc.c
parentxfs: use shifting and masking when converting rt extents, if possible (diff)
downloadkernel-90d98a6ada1da0f8797ff3f5adafd175dd8c0a81.tar.gz
kernel-90d98a6ada1da0f8797ff3f5adafd175dd8c0a81.zip
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 <[email protected]> Reviewed-by: Christoph Hellwig <[email protected]>
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;
}
}
/*