aboutsummaryrefslogtreecommitdiffstats
path: root/fs/btrfs/tests/btrfs-tests.c
diff options
context:
space:
mode:
authorJosef Bacik <josef@toxicpanda.com>2020-02-14 16:11:47 -0500
committerDavid Sterba <dsterba@suse.com>2020-03-23 17:02:00 +0100
commitc75e839414d3610e6487ae3145199c500d55f7f7 (patch)
tree68e609a6362c4f259afc2e107fffac94e743a126 /fs/btrfs/tests/btrfs-tests.c
parentbtrfs: make btrfs_cleanup_fs_roots use the radix tree lock (diff)
downloadlinux-dev-c75e839414d3610e6487ae3145199c500d55f7f7.tar.xz
linux-dev-c75e839414d3610e6487ae3145199c500d55f7f7.zip
btrfs: kill the subvol_srcu
Now that we have proper root ref counting everywhere we can kill the subvol_srcu. * removal of fs_info::subvol_srcu reduces size of fs_info by 1176 bytes * the refcount_t used for the references checks for accidental 0->1 in cases where the root lifetime would not be properly protected * there's a leak detector for roots to catch unfreed roots at umount time * SRCU served us well over the years but is was not a proper synchronization mechanism for some cases Signed-off-by: Josef Bacik <josef@toxicpanda.com> Reviewed-by: David Sterba <dsterba@suse.com> [ update changelog ] Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'fs/btrfs/tests/btrfs-tests.c')
-rw-r--r--fs/btrfs/tests/btrfs-tests.c9
1 files changed, 0 insertions, 9 deletions
diff --git a/fs/btrfs/tests/btrfs-tests.c b/fs/btrfs/tests/btrfs-tests.c
index 42e62fd2809c..999c14e5d0bd 100644
--- a/fs/btrfs/tests/btrfs-tests.c
+++ b/fs/btrfs/tests/btrfs-tests.c
@@ -134,14 +134,6 @@ struct btrfs_fs_info *btrfs_alloc_dummy_fs_info(u32 nodesize, u32 sectorsize)
fs_info->nodesize = nodesize;
fs_info->sectorsize = sectorsize;
-
- if (init_srcu_struct(&fs_info->subvol_srcu)) {
- kfree(fs_info->fs_devices);
- kfree(fs_info->super_copy);
- kfree(fs_info);
- return NULL;
- }
-
set_bit(BTRFS_FS_STATE_DUMMY_FS_INFO, &fs_info->fs_state);
test_mnt->mnt_sb->s_fs_info = fs_info;
@@ -191,7 +183,6 @@ void btrfs_free_dummy_fs_info(struct btrfs_fs_info *fs_info)
}
btrfs_free_qgroup_config(fs_info);
btrfs_free_fs_roots(fs_info);
- cleanup_srcu_struct(&fs_info->subvol_srcu);
kfree(fs_info->super_copy);
btrfs_check_leaked_roots(fs_info);
btrfs_extent_buffer_leak_debug_check(fs_info);