Skip to content

Commit 0c35e7b

Browse files
author
Chandan Babu R
committed
xfs: Use uint64_t to count maximum blocks that can be used by BMBT
Reviewed-by: Darrick J. Wong <djwong@kernel.org> Reviewed-by: Dave Chinner <dchinner@redhat.com> Signed-off-by: Chandan Babu R <chandan.babu@oracle.com>
1 parent 9b7d16e commit 0c35e7b

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

fs/xfs/libxfs/xfs_bmap.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,9 +52,9 @@ xfs_bmap_compute_maxlevels(
5252
xfs_mount_t *mp, /* file system mount structure */
5353
int whichfork) /* data or attr fork */
5454
{
55-
int level; /* btree level */
56-
uint maxblocks; /* max blocks at this level */
55+
uint64_t maxblocks; /* max blocks at this level */
5756
xfs_extnum_t maxleafents; /* max leaf entries possible */
57+
int level; /* btree level */
5858
int maxrootrecs; /* max records in root block */
5959
int minleafrecs; /* min records in leaf block */
6060
int minnoderecs; /* min records in node block */
@@ -88,7 +88,7 @@ xfs_bmap_compute_maxlevels(
8888
if (maxblocks <= maxrootrecs)
8989
maxblocks = 1;
9090
else
91-
maxblocks = (maxblocks + minnoderecs - 1) / minnoderecs;
91+
maxblocks = howmany_64(maxblocks, minnoderecs);
9292
}
9393
mp->m_bm_maxlevels[whichfork] = level;
9494
ASSERT(mp->m_bm_maxlevels[whichfork] <= xfs_bmbt_maxlevels_ondisk());

0 commit comments

Comments
 (0)