]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
xfs: remove xfs_zone_gc_space_available
authorChristoph Hellwig <hch@lst.de>
Tue, 27 Jan 2026 15:10:21 +0000 (16:10 +0100)
committerCarlos Maiolino <cem@kernel.org>
Thu, 29 Jan 2026 09:57:18 +0000 (10:57 +0100)
xfs_zone_gc_space_available only has one caller left, so fold it into
that.  Reorder the checks so that the cheaper scratch_available check
is done first.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Hans Holmberg <hans.holmberg@wdc.com>
Signed-off-by: Carlos Maiolino <cem@kernel.org>
fs/xfs/xfs_zone_gc.c

index 8c08e5519bff1c8ba23c9e0e094854c9f2116647..7bdc5043cc1a79161511b18fa8395140ef3ec5b4 100644 (file)
@@ -578,19 +578,6 @@ xfs_zone_gc_ensure_target(
        return oz;
 }
 
-static bool
-xfs_zone_gc_space_available(
-       struct xfs_zone_gc_data *data)
-{
-       struct xfs_open_zone    *oz;
-
-       oz = xfs_zone_gc_ensure_target(data->mp);
-       if (!oz)
-               return false;
-       return oz->oz_allocated < rtg_blocks(oz->oz_rtg) &&
-               data->scratch_available;
-}
-
 static void
 xfs_zone_gc_end_io(
        struct bio              *bio)
@@ -989,9 +976,15 @@ static bool
 xfs_zone_gc_should_start_new_work(
        struct xfs_zone_gc_data *data)
 {
+       struct xfs_open_zone    *oz;
+
        if (xfs_is_shutdown(data->mp))
                return false;
-       if (!xfs_zone_gc_space_available(data))
+       if (!data->scratch_available)
+               return false;
+
+       oz = xfs_zone_gc_ensure_target(data->mp);
+       if (!oz || oz->oz_allocated == rtg_blocks(oz->oz_rtg))
                return false;
 
        if (!data->iter.victim_rtg) {