]> git.itanic.dy.fi Git - linux-stable/commitdiff
xfs: invert a check in xfs_rtallocate_extent_block
authorChristoph Hellwig <hch@lst.de>
Mon, 18 Dec 2023 04:57:28 +0000 (05:57 +0100)
committerChandan Babu R <chandanbabu@kernel.org>
Fri, 22 Dec 2023 05:48:12 +0000 (11:18 +0530)
Doing a break in the else side of a conditional is rather silly.  Invert
the check, break ASAP and unindent the other leg.

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>
fs/xfs/xfs_rtalloc.c

index 0475693bc1991462b9b168d656f00581c9c0100f..abcbd0c95b3015b98a07ff8c28c0e38bc1894202 100644 (file)
@@ -283,12 +283,11 @@ xfs_rtallocate_extent_block(
                /*
                 * If not done yet, find the start of the next free space.
                 */
-               if (next < end) {
-                       error = xfs_rtfind_forw(args, next, end, &i);
-                       if (error)
-                               return error;
-               } else
+               if (next >= end)
                        break;
+               error = xfs_rtfind_forw(args, next, end, &i);
+               if (error)
+                       return error;
        }
        /*
         * Searched the whole thing & didn't find a maxlen free extent.