diff options
| author | Christoph Hellwig <hch@lst.de> | 2026-01-27 16:10:21 +0100 |
|---|---|---|
| committer | Carlos Maiolino <cem@kernel.org> | 2026-01-29 10:57:18 +0100 |
| commit | 7da4ebea8332e6b2fb15edc71e5443c15826af49 (patch) | |
| tree | 3620014fa56406d4a3d8d5e0f60388b8acbdd593 | |
| parent | c17a1c03493bee4e7882ac79a52b8150cb464e56 (diff) | |
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>
| -rw-r--r-- | fs/xfs/xfs_zone_gc.c | 21 |
1 files changed, 7 insertions, 14 deletions
diff --git a/fs/xfs/xfs_zone_gc.c b/fs/xfs/xfs_zone_gc.c index 8c08e5519bff..7bdc5043cc1a 100644 --- a/fs/xfs/xfs_zone_gc.c +++ b/fs/xfs/xfs_zone_gc.c @@ -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) { |
