Skip to content

Commit 7da4ebe

Browse files
Christoph Hellwigcmaiolino
authored andcommitted
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>
1 parent c17a1c0 commit 7da4ebe

1 file changed

Lines changed: 7 additions & 14 deletions

File tree

fs/xfs/xfs_zone_gc.c

Lines changed: 7 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -578,19 +578,6 @@ xfs_zone_gc_ensure_target(
578578
return oz;
579579
}
580580

581-
static bool
582-
xfs_zone_gc_space_available(
583-
struct xfs_zone_gc_data *data)
584-
{
585-
struct xfs_open_zone *oz;
586-
587-
oz = xfs_zone_gc_ensure_target(data->mp);
588-
if (!oz)
589-
return false;
590-
return oz->oz_allocated < rtg_blocks(oz->oz_rtg) &&
591-
data->scratch_available;
592-
}
593-
594581
static void
595582
xfs_zone_gc_end_io(
596583
struct bio *bio)
@@ -989,9 +976,15 @@ static bool
989976
xfs_zone_gc_should_start_new_work(
990977
struct xfs_zone_gc_data *data)
991978
{
979+
struct xfs_open_zone *oz;
980+
992981
if (xfs_is_shutdown(data->mp))
993982
return false;
994-
if (!xfs_zone_gc_space_available(data))
983+
if (!data->scratch_available)
984+
return false;
985+
986+
oz = xfs_zone_gc_ensure_target(data->mp);
987+
if (!oz || oz->oz_allocated == rtg_blocks(oz->oz_rtg))
995988
return false;
996989

997990
if (!data->iter.victim_rtg) {

0 commit comments

Comments
 (0)