mirror of
https://github.com/torvalds/linux.git
synced 2026-05-24 07:03:03 +02:00
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:
parent
c17a1c0349
commit
7da4ebea83
|
|
@ -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) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user