summaryrefslogtreecommitdiff
path: root/fs/btrfs/tests/extent-buffer-tests.c
diff options
context:
space:
mode:
authorChris Mason <clm@fb.com>2016-07-26 13:07:05 -0700
committerChris Mason <clm@fb.com>2016-07-26 13:07:05 -0700
commit023a824f04754a4ed5efc16ee8e41bb932878b0b (patch)
tree8ae0bc5a61945bdec42d6c7a929967c548031d5d /fs/btrfs/tests/extent-buffer-tests.c
parent8b8b08cbfb9021af4b54b4175fc4c51d655aac8c (diff)
parent66642832f06a4351e23cea6cf254967c227f8224 (diff)
downloadlinux-023a824f04754a4ed5efc16ee8e41bb932878b0b.tar.gz
linux-023a824f04754a4ed5efc16ee8e41bb932878b0b.tar.xz
Merge branch 'kdave-v4.8' into for-linus-4.8
Diffstat (limited to 'fs/btrfs/tests/extent-buffer-tests.c')
-rw-r--r--fs/btrfs/tests/extent-buffer-tests.c23
1 files changed, 16 insertions, 7 deletions
diff --git a/fs/btrfs/tests/extent-buffer-tests.c b/fs/btrfs/tests/extent-buffer-tests.c
index 4f8cbd1ec5ee..199569174637 100644
--- a/fs/btrfs/tests/extent-buffer-tests.c
+++ b/fs/btrfs/tests/extent-buffer-tests.c
@@ -24,8 +24,9 @@
static int test_btrfs_split_item(u32 sectorsize, u32 nodesize)
{
- struct btrfs_path *path;
- struct btrfs_root *root;
+ struct btrfs_fs_info *fs_info;
+ struct btrfs_path *path = NULL;
+ struct btrfs_root *root = NULL;
struct extent_buffer *eb;
struct btrfs_item *item;
char *value = "mary had a little lamb";
@@ -40,17 +41,24 @@ static int test_btrfs_split_item(u32 sectorsize, u32 nodesize)
test_msg("Running btrfs_split_item tests\n");
- root = btrfs_alloc_dummy_root(sectorsize, nodesize);
+ fs_info = btrfs_alloc_dummy_fs_info();
+ if (!fs_info) {
+ test_msg("Could not allocate fs_info\n");
+ return -ENOMEM;
+ }
+
+ root = btrfs_alloc_dummy_root(fs_info, sectorsize, nodesize);
if (IS_ERR(root)) {
test_msg("Could not allocate root\n");
- return PTR_ERR(root);
+ ret = PTR_ERR(root);
+ goto out;
}
path = btrfs_alloc_path();
if (!path) {
test_msg("Could not allocate path\n");
- kfree(root);
- return -ENOMEM;
+ ret = -ENOMEM;
+ goto out;
}
path->nodes[0] = eb = alloc_dummy_extent_buffer(NULL, nodesize,
@@ -219,7 +227,8 @@ static int test_btrfs_split_item(u32 sectorsize, u32 nodesize)
}
out:
btrfs_free_path(path);
- kfree(root);
+ btrfs_free_dummy_root(root);
+ btrfs_free_dummy_fs_info(fs_info);
return ret;
}