diff options
author | Jeff Mahoney <jeffm@suse.com> | 2016-06-20 20:14:09 +0200 |
---|---|---|
committer | David Sterba <dsterba@suse.com> | 2016-07-26 13:53:18 +0200 |
commit | 7c0260ee098db7a05fd68812b2e21ce2e19dfcf0 (patch) | |
tree | 25e787514a685917ab6b11535275e831001d24f5 /fs/btrfs/tests/free-space-tree-tests.c | |
parent | btrfs: tests, move initialization into tests/ (diff) | |
download | linux-7c0260ee098db7a05fd68812b2e21ce2e19dfcf0.tar.xz linux-7c0260ee098db7a05fd68812b2e21ce2e19dfcf0.zip |
btrfs: tests, require fs_info for root
This allows the upcoming patchset to push nodesize and sectorsize into
fs_info.
Signed-off-by: Jeff Mahoney <jeffm@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'fs/btrfs/tests/free-space-tree-tests.c')
-rw-r--r-- | fs/btrfs/tests/free-space-tree-tests.c | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/fs/btrfs/tests/free-space-tree-tests.c b/fs/btrfs/tests/free-space-tree-tests.c index aac507085ab0..7508d3b42780 100644 --- a/fs/btrfs/tests/free-space-tree-tests.c +++ b/fs/btrfs/tests/free-space-tree-tests.c @@ -443,23 +443,24 @@ typedef int (*test_func_t)(struct btrfs_trans_handle *, static int run_test(test_func_t test_func, int bitmaps, u32 sectorsize, u32 nodesize) { + struct btrfs_fs_info *fs_info; struct btrfs_root *root = NULL; struct btrfs_block_group_cache *cache = NULL; struct btrfs_trans_handle trans; struct btrfs_path *path = NULL; int ret; - root = btrfs_alloc_dummy_root(sectorsize, nodesize); - if (IS_ERR(root)) { - test_msg("Couldn't allocate dummy root\n"); - ret = PTR_ERR(root); + fs_info = btrfs_alloc_dummy_fs_info(); + if (!fs_info) { + test_msg("Couldn't allocate dummy fs info\n"); + ret = -ENOMEM; goto out; } - root->fs_info = btrfs_alloc_dummy_fs_info(); - if (!root->fs_info) { - test_msg("Couldn't allocate dummy fs info\n"); - ret = -ENOMEM; + root = btrfs_alloc_dummy_root(fs_info, sectorsize, nodesize); + if (IS_ERR(root)) { + test_msg("Couldn't allocate dummy root\n"); + ret = PTR_ERR(root); goto out; } @@ -534,6 +535,7 @@ out: btrfs_free_path(path); btrfs_free_dummy_block_group(cache); btrfs_free_dummy_root(root); + btrfs_free_dummy_fs_info(fs_info); return ret; } |