]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commitdiff
xfs: remove XFS_RTMIN/XFS_RTMAX
authorChristoph Hellwig <hch@lst.de>
Mon, 15 Apr 2024 23:07:41 +0000 (16:07 -0700)
committerDarrick J. Wong <djwong@kernel.org>
Wed, 17 Apr 2024 21:06:26 +0000 (14:06 -0700)
Source kernel commit: a39f5ccc30d5a00b7e6d921aa387ad17d1e6d168

Use the kernel min/max helpers instead.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: "Darrick J. Wong" <djwong@kernel.org>
Signed-off-by: Chandan Babu R <chandanbabu@kernel.org>
Reviewed-by: Bill O'Donnell <bodonnel@redhat.com>
libxfs/xfs_format.h
libxfs/xfs_rtbitmap.c
mkfs/proto.c

index 7d2873a79a48a5cc538dad1499637c76547f4fd7..382ab1e71c0b6c43b74a937ed9e935967253a858 100644 (file)
@@ -1156,12 +1156,6 @@ static inline bool xfs_dinode_has_large_extent_counts(
 #define        XFS_DFL_RTEXTSIZE       (64 * 1024)             /* 64kB */
 #define        XFS_MIN_RTEXTSIZE       (4 * 1024)              /* 4kB */
 
-/*
- * RT bit manipulation macros.
- */
-#define        XFS_RTMIN(a,b)  ((a) < (b) ? (a) : (b))
-#define        XFS_RTMAX(a,b)  ((a) > (b) ? (a) : (b))
-
 /*
  * Dquot and dquot block format definitions
  */
index eefc45c64e2027df29df5f64c5e239d297829eae..79af7cda3441d5c7e741c9a811eed04a232a0093 100644 (file)
@@ -182,7 +182,7 @@ xfs_rtfind_back(
                 * Calculate first (leftmost) bit number to look at,
                 * and mask for all the relevant bits in this word.
                 */
-               firstbit = XFS_RTMAX((xfs_srtblock_t)(bit - len + 1), 0);
+               firstbit = max_t(xfs_srtblock_t, bit - len + 1, 0);
                mask = (((xfs_rtword_t)1 << (bit - firstbit + 1)) - 1) <<
                        firstbit;
                /*
@@ -336,7 +336,7 @@ xfs_rtfind_forw(
                 * Calculate last (rightmost) bit number to look at,
                 * and mask for all the relevant bits in this word.
                 */
-               lastbit = XFS_RTMIN(bit + len, XFS_NBWORD);
+               lastbit = min(bit + len, XFS_NBWORD);
                mask = (((xfs_rtword_t)1 << (lastbit - bit)) - 1) << bit;
                /*
                 * Calculate the difference between the value there
@@ -571,7 +571,7 @@ xfs_rtmodify_range(
                /*
                 * Compute first bit not changed and mask of relevant bits.
                 */
-               lastbit = XFS_RTMIN(bit + len, XFS_NBWORD);
+               lastbit = min(bit + len, XFS_NBWORD);
                mask = (((xfs_rtword_t)1 << (lastbit - bit)) - 1) << bit;
                /*
                 * Set/clear the active bits.
@@ -785,7 +785,7 @@ xfs_rtcheck_range(
                /*
                 * Compute first bit not examined.
                 */
-               lastbit = XFS_RTMIN(bit + len, XFS_NBWORD);
+               lastbit = min(bit + len, XFS_NBWORD);
                /*
                 * Mask of relevant bits.
                 */
index f8e00c4b56f02807674cef7d13fa7c89029785a0..10b929b2ec37d990a51c09e81a94d4feb7257a5f 100644 (file)
@@ -793,8 +793,8 @@ rtfreesp_init(
                        res_failed(error);
 
                libxfs_trans_ijoin(tp, mp->m_rbmip, 0);
-               ertx = XFS_RTMIN(mp->m_sb.sb_rextents,
-                       rtx + NBBY * mp->m_sb.sb_blocksize);
+               ertx = min(mp->m_sb.sb_rextents,
+                          rtx + NBBY * mp->m_sb.sb_blocksize);
 
                error = -libxfs_rtfree_extent(tp, rtx,
                                (xfs_rtxlen_t)(ertx - rtx));