]> www.infradead.org Git - users/hch/xfs.git/commitdiff
xfs: remove xfs_validate_rtextents
authorChristoph Hellwig <hch@lst.de>
Tue, 30 Jul 2024 17:54:04 +0000 (10:54 -0700)
committerDarrick J. Wong <djwong@kernel.org>
Thu, 1 Aug 2024 00:10:05 +0000 (17:10 -0700)
Replace xfs_validate_rtextents with an open coded check for 0
rtextents.  The name for the function implies it does a lot more
than a zero check, which is more obvious when open coded.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Darrick J. Wong <djwong@kernel.org>
Signed-off-by: Darrick J. Wong <djwong@kernel.org>
fs/xfs/libxfs/xfs_sb.c
fs/xfs/libxfs/xfs_types.h
fs/xfs/xfs_rtalloc.c

index 1dcbf8ade39f87365d620f0bdfd6cd45cad642fd..b781e5f836e4ce364e05b07caef5ab6062e4a6d9 100644 (file)
@@ -516,7 +516,7 @@ xfs_validate_sb_common(
                rbmblocks = howmany_64(sbp->sb_rextents,
                                       NBBY * sbp->sb_blocksize);
 
-               if (!xfs_validate_rtextents(rexts) ||
+               if (sbp->sb_rextents == 0 ||
                    sbp->sb_rextents != rexts ||
                    sbp->sb_rextslog != xfs_compute_rextslog(rexts) ||
                    sbp->sb_rbmblocks != rbmblocks) {
index 76eb9e328835f8be1a7135d15704462e2365aa42..a8cd44d03ef6487a2505075e28ad912db51f54c2 100644 (file)
@@ -235,16 +235,4 @@ bool xfs_verify_fileoff(struct xfs_mount *mp, xfs_fileoff_t off);
 bool xfs_verify_fileext(struct xfs_mount *mp, xfs_fileoff_t off,
                xfs_fileoff_t len);
 
-/* Do we support an rt volume having this number of rtextents? */
-static inline bool
-xfs_validate_rtextents(
-       xfs_rtbxlen_t           rtextents)
-{
-       /* No runt rt volumes */
-       if (rtextents == 0)
-               return false;
-
-       return true;
-}
-
 #endif /* __XFS_TYPES_H__ */
index 3eb402cce2f58fc4c73c23f3a57c37edfdbbf79a..51e6e8a09838569143f4a74230e7cd9c82bc3727 100644 (file)
@@ -866,7 +866,7 @@ xfs_growfs_rt(
         */
        nrextents = nrblocks;
        do_div(nrextents, in->extsize);
-       if (!xfs_validate_rtextents(nrextents))
+       if (nrextents == 0)
                return -EINVAL;
        nrbmblocks = xfs_rtbitmap_blockcount(mp, nrextents);
        nrextslog = xfs_compute_rextslog(nrextents);