linux-stable/fs/btrfs/tests
Josef Bacik cd79909bc7 btrfs: load free space cache into a temporary ctl
The free space cache has been special in that we would load it right
away instead of farming the work off to a worker thread.  This resulted
in some weirdness that had to be taken into account for this fact,
namely that if we every found a block group being cached the fast way we
had to wait for it to finish, because we could get the cache before it
had been validated and we may throw the cache away.

To handle this particular case instead create a temporary
btrfs_free_space_ctl to load the free space cache into.  Then once we've
validated that it makes sense, copy it's contents into the actual
block_group->free_space_ctl.  This allows us to avoid the problems of
needing to wait for the caching to complete, we can clean up the discard
extent handling stuff in __load_free_space_cache, and we no longer need
to do the merge_space_tree() because the space is added one by one into
the real free_space_ctl.  This will allow further reworks of how we
handle loading the free space cache.

Reviewed-by: Filipe Manana <fdmanana@suse.com>
Signed-off-by: Josef Bacik <josef@toxicpanda.com>
Signed-off-by: David Sterba <dsterba@suse.com>
2020-12-08 15:54:03 +01:00
..
btrfs-tests.c btrfs: load free space cache into a temporary ctl 2020-12-08 15:54:03 +01:00
btrfs-tests.h btrfs: selftests: Add support for dummy devices 2020-01-23 17:24:34 +01:00
extent-buffer-tests.c btrfs: sink total_data parameter in setup_items_for_insert 2020-10-07 12:13:18 +02:00
extent-io-tests.c btrfs: Correctly handle empty trees in find_first_clear_extent_bit 2020-01-31 14:01:29 +01:00
extent-map-tests.c btrfs: Add self-tests for btrfs_rmap_block 2020-01-23 17:24:35 +01:00
free-space-tests.c btrfs: rename btrfs_block_group_cache 2019-11-18 17:51:51 +01:00
free-space-tree-tests.c btrfs: tests: remove if duplicate in __check_free_space_extents() 2020-07-27 12:55:27 +02:00
inode-tests.c btrfs: fix missing delalloc new bit for new delalloc ranges 2020-11-13 22:15:59 +01:00
qgroup-tests.c btrfs: locking: rip out path->leave_spinning 2020-12-08 15:54:02 +01:00