btrfs: simplify the logic in need_preemptive_flushing
authorJosef Bacik <josef@toxicpanda.com>
Fri, 9 Oct 2020 13:28:26 +0000 (09:28 -0400)
committerDavid Sterba <dsterba@suse.com>
Mon, 8 Feb 2021 21:58:59 +0000 (22:58 +0100)
commit2e294c60497f29ab8791f4b99f348b22d70dd3c3
treecb40e6dc6eed38e728df2c5e514d3ad227d9d617
parent9f42d37748264d65ca611b60c22b9c003030b0b3
btrfs: simplify the logic in need_preemptive_flushing

A lot of this was added all in one go with no explanation, and is a bit
unwieldy and confusing.  Simplify the logic to start preemptive flushing
if we've reserved more than half of our available free space.

Reviewed-by: Nikolay Borisov <nborisov@suse.com>
Signed-off-by: Josef Bacik <josef@toxicpanda.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/space-info.c