btrfs: skip space_cache v1 setup when not using it
authorBoris Burkov <boris@bur.io>
Wed, 18 Nov 2020 23:06:26 +0000 (15:06 -0800)
committerDavid Sterba <dsterba@suse.com>
Wed, 9 Dec 2020 18:16:09 +0000 (19:16 +0100)
commitaf456a2c0aaaff15b84f046e2545570bf1bf50ed
tree0fb250f9ad538c42f3721b916d8c1806b5aebd81
parent36b216c85eb9d7f59ac1cb8b117376e20acc6cbc
btrfs: skip space_cache v1 setup when not using it

If we are not using space cache v1, we should not create the free space
object or free space inodes. This comes up when we delete the existing
free space objects/inodes when migrating to v2, only to see them get
recreated for every dirtied block group.

Reviewed-by: Josef Bacik <josef@toxicpanda.com>
Signed-off-by: Boris Burkov <boris@bur.io>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/block-group.c