]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commitdiff
xfs: remove the limit argument to xfs_rtfind_back
authorChristoph Hellwig <hch@lst.de>
Mon, 21 Oct 2024 00:10:41 +0000 (17:10 -0700)
committerDarrick J. Wong <djwong@kernel.org>
Thu, 31 Oct 2024 22:45:02 +0000 (15:45 -0700)
Source kernel commit: 119c65e56bc131b466a7cd958a4089e286ce3c4b

All callers pass a 0 limit to xfs_rtfind_back, so remove the argument
and hard code it.

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>
libxfs/xfs_rtbitmap.c
libxfs/xfs_rtbitmap.h

index 58a3ba992f51cc8151648c2b897194df0d24309e..c7613f2de7b0a07245a1a35c1016a412b112f3f0 100644 (file)
@@ -137,14 +137,13 @@ xfs_rtbuf_get(
 }
 
 /*
- * Searching backward from start to limit, find the first block whose
- * allocated/free state is different from start's.
+ * Searching backward from start find the first block whose allocated/free state
+ * is different from start's.
  */
 int
 xfs_rtfind_back(
        struct xfs_rtalloc_args *args,
        xfs_rtxnum_t            start,  /* starting rtext to look at */
-       xfs_rtxnum_t            limit,  /* last rtext to look at */
        xfs_rtxnum_t            *rtx)   /* out: start rtext found */
 {
        struct xfs_mount        *mp = args->mp;
@@ -173,7 +172,7 @@ xfs_rtfind_back(
         */
        word = xfs_rtx_to_rbmword(mp, start);
        bit = (int)(start & (XFS_NBWORD - 1));
-       len = start - limit + 1;
+       len = start + 1;
        /*
         * Compute match value, based on the bit at start: if 1 (free)
         * then all-ones, else all-zeroes.
@@ -696,7 +695,7 @@ xfs_rtfree_range(
         * We need to find the beginning and end of the extent so we can
         * properly update the summary.
         */
-       error = xfs_rtfind_back(args, start, 0, &preblock);
+       error = xfs_rtfind_back(args, start, &preblock);
        if (error) {
                return error;
        }
index 6186585f2c376d97ba1d20b1a0666147d34c55b7..1e04f0954a0fa7dd2d7852b62763d7355f55cfd6 100644 (file)
@@ -316,7 +316,7 @@ xfs_rtsummary_read_buf(
 int xfs_rtcheck_range(struct xfs_rtalloc_args *args, xfs_rtxnum_t start,
                xfs_rtxlen_t len, int val, xfs_rtxnum_t *new, int *stat);
 int xfs_rtfind_back(struct xfs_rtalloc_args *args, xfs_rtxnum_t start,
-               xfs_rtxnum_t limit, xfs_rtxnum_t *rtblock);
+               xfs_rtxnum_t *rtblock);
 int xfs_rtfind_forw(struct xfs_rtalloc_args *args, xfs_rtxnum_t start,
                xfs_rtxnum_t limit, xfs_rtxnum_t *rtblock);
 int xfs_rtmodify_range(struct xfs_rtalloc_args *args, xfs_rtxnum_t start,