@@ -3647,7 +3647,7 @@ process_rtbitmap(
} else if (prevbit == 1) {
len = ((int)bmbno - start_bmbno) *
bitsperblock + (bit - start_bit);
- log = XFS_RTBLOCKLOG(len);
+ log = xfs_highbit64(len);
offs = xfs_rtsumoffs(mp, log, start_bmbno);
sumcompute[offs]++;
prevbit = 0;
@@ -3660,7 +3660,7 @@ process_rtbitmap(
if (prevbit == 1) {
len = ((int)bmbno - start_bmbno) * bitsperblock +
(bit - start_bit);
- log = XFS_RTBLOCKLOG(len);
+ log = xfs_highbit64(len);
offs = xfs_rtsumoffs(mp, log, start_bmbno);
sumcompute[offs]++;
}
@@ -1156,20 +1156,12 @@ static inline bool xfs_dinode_has_large_extent_counts(
#define XFS_DFL_RTEXTSIZE (64 * 1024) /* 64kB */
#define XFS_MIN_RTEXTSIZE (4 * 1024) /* 4kB */
-#define XFS_BLOCKSIZE(mp) ((mp)->m_sb.sb_blocksize)
-#define XFS_BLOCKMASK(mp) ((mp)->m_blockmask)
-
/*
* RT bit manipulation macros.
*/
#define XFS_RTMIN(a,b) ((a) < (b) ? (a) : (b))
#define XFS_RTMAX(a,b) ((a) > (b) ? (a) : (b))
-#define XFS_RTLOBIT(w) xfs_lowbit32(w)
-#define XFS_RTHIBIT(w) xfs_highbit32(w)
-
-#define XFS_RTBLOCKLOG(b) xfs_highbit64(b)
-
/*
* Dquot and dquot block format definitions
*/
@@ -193,7 +193,7 @@ xfs_rtfind_back(
/*
* Different. Mark where we are and return.
*/
- i = bit - XFS_RTHIBIT(wdiff);
+ i = bit - xfs_highbit32(wdiff);
*rtx = start - i + 1;
return 0;
}
@@ -231,7 +231,7 @@ xfs_rtfind_back(
/*
* Different, mark where we are and return.
*/
- i += XFS_NBWORD - 1 - XFS_RTHIBIT(wdiff);
+ i += XFS_NBWORD - 1 - xfs_highbit32(wdiff);
*rtx = start - i + 1;
return 0;
}
@@ -270,7 +270,7 @@ xfs_rtfind_back(
/*
* Different, mark where we are and return.
*/
- i += XFS_NBWORD - 1 - XFS_RTHIBIT(wdiff);
+ i += XFS_NBWORD - 1 - xfs_highbit32(wdiff);
*rtx = start - i + 1;
return 0;
} else
@@ -346,7 +346,7 @@ xfs_rtfind_forw(
/*
* Different. Mark where we are and return.
*/
- i = XFS_RTLOBIT(wdiff) - bit;
+ i = xfs_lowbit32(wdiff) - bit;
*rtx = start + i - 1;
return 0;
}
@@ -384,7 +384,7 @@ xfs_rtfind_forw(
/*
* Different, mark where we are and return.
*/
- i += XFS_RTLOBIT(wdiff);
+ i += xfs_lowbit32(wdiff);
*rtx = start + i - 1;
return 0;
}
@@ -421,7 +421,7 @@ xfs_rtfind_forw(
/*
* Different, mark where we are and return.
*/
- i += XFS_RTLOBIT(wdiff);
+ i += xfs_lowbit32(wdiff);
*rtx = start + i - 1;
return 0;
} else
@@ -706,7 +706,7 @@ xfs_rtfree_range(
*/
if (preblock < start) {
error = xfs_rtmodify_summary(args,
- XFS_RTBLOCKLOG(start - preblock),
+ xfs_highbit64(start - preblock),
xfs_rtx_to_rbmblock(mp, preblock), -1);
if (error) {
return error;
@@ -718,7 +718,7 @@ xfs_rtfree_range(
*/
if (postblock > end) {
error = xfs_rtmodify_summary(args,
- XFS_RTBLOCKLOG(postblock - end),
+ xfs_highbit64(postblock - end),
xfs_rtx_to_rbmblock(mp, end + 1), -1);
if (error) {
return error;
@@ -729,7 +729,7 @@ xfs_rtfree_range(
* (new) free extent.
*/
return xfs_rtmodify_summary(args,
- XFS_RTBLOCKLOG(postblock + 1 - preblock),
+ xfs_highbit64(postblock + 1 - preblock),
xfs_rtx_to_rbmblock(mp, preblock), 1);
}
@@ -798,7 +798,7 @@ xfs_rtcheck_range(
/*
* Different, compute first wrong bit and return.
*/
- i = XFS_RTLOBIT(wdiff) - bit;
+ i = xfs_lowbit32(wdiff) - bit;
*new = start + i;
*stat = 0;
return 0;
@@ -837,7 +837,7 @@ xfs_rtcheck_range(
/*
* Different, compute first wrong bit and return.
*/
- i += XFS_RTLOBIT(wdiff);
+ i += xfs_lowbit32(wdiff);
*new = start + i;
*stat = 0;
return 0;
@@ -875,7 +875,7 @@ xfs_rtcheck_range(
/*
* Different, compute first wrong bit and return.
*/
- i += XFS_RTLOBIT(wdiff);
+ i += xfs_lowbit32(wdiff);
*new = start + i;
*stat = 0;
return 0;
@@ -14,8 +14,6 @@
#include "err_protos.h"
#include "rt.h"
-#define xfs_highbit64 libxfs_highbit64 /* for XFS_RTBLOCKLOG macro */
-
void
rtinit(xfs_mount_t *mp)
{
@@ -90,7 +88,7 @@ generate_rtinfo(xfs_mount_t *mp,
}
} else if (in_extent == 1) {
len = (int) (extno - start_ext);
- log = XFS_RTBLOCKLOG(len);
+ log = libxfs_highbit64(len);
offs = xfs_rtsumoffs(mp, log, start_bmbno);
sumcompute[offs]++;
in_extent = 0;
@@ -106,7 +104,7 @@ generate_rtinfo(xfs_mount_t *mp,
}
if (in_extent == 1) {
len = (int) (extno - start_ext);
- log = XFS_RTBLOCKLOG(len);
+ log = libxfs_highbit64(len);
offs = xfs_rtsumoffs(mp, log, start_bmbno);
sumcompute[offs]++;
}