btrfs: check worker before need_preemptive_reclaim
authorJosef Bacik <josef@toxicpanda.com>
Wed, 28 Apr 2021 17:38:42 +0000 (13:38 -0400)
committerDavid Sterba <dsterba@suse.com>
Mon, 21 Jun 2021 13:19:04 +0000 (15:19 +0200)
commited738ba7f96170384f3e94a38be5536560eabc00
tree7bc232908f5acfce0812b969f327aac9bf5a7cfa
parent94358c35d80a8de5054c295d48332611d48222b4
btrfs: check worker before need_preemptive_reclaim

need_preemptive_reclaim() does some calculations, which aren't heavy,
but if we're already running preemptive reclaim there's no reason to do
them at all, so re-order the checks so that we don't do the calculation
if we're already doing reclaim.

Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
Signed-off-by: Josef Bacik <josef@toxicpanda.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/space-info.c