Commit 0c35e7ba authored by Chandan Babu R's avatar Chandan Babu R

xfs: Use uint64_t to count maximum blocks that can be used by BMBT

Reviewed-by: default avatarDarrick J. Wong <djwong@kernel.org>
Reviewed-by: default avatarDave Chinner <dchinner@redhat.com>
Signed-off-by: default avatarChandan Babu R <chandan.babu@oracle.com>
parent 9b7d16e3
...@@ -52,9 +52,9 @@ xfs_bmap_compute_maxlevels( ...@@ -52,9 +52,9 @@ xfs_bmap_compute_maxlevels(
xfs_mount_t *mp, /* file system mount structure */ xfs_mount_t *mp, /* file system mount structure */
int whichfork) /* data or attr fork */ int whichfork) /* data or attr fork */
{ {
int level; /* btree level */ uint64_t maxblocks; /* max blocks at this level */
uint maxblocks; /* max blocks at this level */
xfs_extnum_t maxleafents; /* max leaf entries possible */ xfs_extnum_t maxleafents; /* max leaf entries possible */
int level; /* btree level */
int maxrootrecs; /* max records in root block */ int maxrootrecs; /* max records in root block */
int minleafrecs; /* min records in leaf block */ int minleafrecs; /* min records in leaf block */
int minnoderecs; /* min records in node block */ int minnoderecs; /* min records in node block */
...@@ -88,7 +88,7 @@ xfs_bmap_compute_maxlevels( ...@@ -88,7 +88,7 @@ xfs_bmap_compute_maxlevels(
if (maxblocks <= maxrootrecs) if (maxblocks <= maxrootrecs)
maxblocks = 1; maxblocks = 1;
else else
maxblocks = (maxblocks + minnoderecs - 1) / minnoderecs; maxblocks = howmany_64(maxblocks, minnoderecs);
} }
mp->m_bm_maxlevels[whichfork] = level; mp->m_bm_maxlevels[whichfork] = level;
ASSERT(mp->m_bm_maxlevels[whichfork] <= xfs_bmbt_maxlevels_ondisk()); ASSERT(mp->m_bm_maxlevels[whichfork] <= xfs_bmbt_maxlevels_ondisk());
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment