xfs: remove xfs_zone_gc_space_available

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>
This commit is contained in:
Christoph Hellwig 2026-01-27 16:10:21 +01:00 committed by Carlos Maiolino
parent c17a1c0349
commit 7da4ebea83

View 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) {