btrfs: move the root freeing stuff into btrfs_put_root
[sfrench/cifs-2.6.git] / fs / btrfs / tests / btrfs-tests.c
index 69c9afef06e3229f5aaa8f17e4875de3a66f9e0a..42e62fd2809c14e9fdf156cb29f9823fb0ef82bd 100644 (file)
@@ -194,6 +194,7 @@ void btrfs_free_dummy_fs_info(struct btrfs_fs_info *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);
        kfree(fs_info->fs_devices);
        kfree(fs_info);
 }
@@ -205,10 +206,6 @@ void btrfs_free_dummy_root(struct btrfs_root *root)
        /* Will be freed by btrfs_free_fs_roots */
        if (WARN_ON(test_bit(BTRFS_ROOT_IN_RADIX, &root->state)))
                return;
-       if (root->node) {
-               /* One for allocate_extent_buffer */
-               free_extent_buffer(root->node);
-       }
        btrfs_put_root(root);
 }