summaryrefslogtreecommitdiff
path: root/fs/xfs/xfs_rtalloc.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/xfs/xfs_rtalloc.c')
-rw-r--r--fs/xfs/xfs_rtalloc.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/fs/xfs/xfs_rtalloc.c b/fs/xfs/xfs_rtalloc.c
index be93542827cf..4b8fc8e510ac 100644
--- a/fs/xfs/xfs_rtalloc.c
+++ b/fs/xfs/xfs_rtalloc.c
@@ -638,9 +638,10 @@ xfs_rtallocate_extent_size(
* for this summary level.
*/
for (l = xfs_highbit32(maxlen); l >= xfs_highbit32(minlen); l--) {
- error = xfs_rtalloc_sumlevel(args, l, XFS_RTMAX(minlen, 1 << l),
- XFS_RTMIN(maxlen, (1 << (l + 1)) - 1), prod,
- len, rtx);
+ error = xfs_rtalloc_sumlevel(args, l,
+ max_t(xfs_rtxlen_t, minlen, 1 << l),
+ min_t(xfs_rtxlen_t, maxlen, (1 << (l + 1)) - 1),
+ prod, len, rtx);
if (error != -ENOSPC)
return error;
}