]> git.baikalelectronics.ru Git - kernel.git/commit
btrfs: don't include the global rsv size in the preemptive used amount
authorJosef Bacik <josef@toxicpanda.com>
Wed, 28 Apr 2021 17:38:46 +0000 (13:38 -0400)
committerDavid Sterba <dsterba@suse.com>
Mon, 21 Jun 2021 13:19:04 +0000 (15:19 +0200)
commit6f3b5f977b9cff79ae73cc284f114265a93d4a0d
treecff94d080171531a679a5adb2e272dc86db9c0c1
parent9fa4cfb175513e4d5e3d2dc992f1ed70d61f0bb6
btrfs: don't include the global rsv size in the preemptive used amount

When deciding if we should preemptively flush space, we will add in the
amount of space used by all block rsvs.  However this also includes the
global block rsv, which isn't flushable so shouldn't be accounted for in
this calculation.  If we decide to use ->bytes_may_use in our used
calculation we need to subtract the global rsv size from this amount so
it most closely matches the flushable space.

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