]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commitdiff
xfs: Use uint64_t to count maximum blocks that can be used by BMBT
authorChandan Babu R <chandan.babu@oracle.com>
Wed, 22 Jun 2022 19:28:52 +0000 (14:28 -0500)
committerEric Sandeen <sandeen@sandeen.net>
Wed, 22 Jun 2022 19:28:52 +0000 (14:28 -0500)
Source kernel commit: 0c35e7ba18508e9344a1f27b412924bc8b34eba8

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>
Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
libxfs/xfs_bmap.c

index 1459834677545295b21377a61ec892d0b9cde733..40764571b75ab10388efa7f4bf90c40798c62fea 100644 (file)
@@ -45,9 +45,9 @@ xfs_bmap_compute_maxlevels(
        xfs_mount_t     *mp,            /* file system mount structure */
        int             whichfork)      /* data or attr fork */
 {
-       int             level;          /* btree level */
-       uint            maxblocks;      /* max blocks at this level */
+       uint64_t        maxblocks;      /* max blocks at this level */
        xfs_extnum_t    maxleafents;    /* max leaf entries possible */
+       int             level;          /* btree level */
        int             maxrootrecs;    /* max records in root block */
        int             minleafrecs;    /* min records in leaf block */
        int             minnoderecs;    /* min records in node block */
@@ -81,7 +81,7 @@ xfs_bmap_compute_maxlevels(
                if (maxblocks <= maxrootrecs)
                        maxblocks = 1;
                else
-                       maxblocks = (maxblocks + minnoderecs - 1) / minnoderecs;
+                       maxblocks = howmany_64(maxblocks, minnoderecs);
        }
        mp->m_bm_maxlevels[whichfork] = level;
        ASSERT(mp->m_bm_maxlevels[whichfork] <= xfs_bmbt_maxlevels_ondisk());