diff options
author | Jeff Mahoney <jeffm@suse.com> | 2016-06-21 09:52:41 -0400 |
---|---|---|
committer | David Sterba <dsterba@suse.com> | 2016-07-26 07:54:19 -0400 |
commit | f5ee5c9ac56cd328fcc915582f81226affebd81c (patch) | |
tree | a8794c47784f0565553233353702d02fd2e5fc28 /fs/btrfs/disk-io.c | |
parent | 7c0260ee098db7a05fd68812b2e21ce2e19dfcf0 (diff) |
btrfs: tests, use BTRFS_FS_STATE_DUMMY_FS_INFO instead of dummy root
Now that we have a dummy fs_info associated with each test that
uses a root, we don't need the DUMMY_ROOT bit anymore. This lets
us make choices without needing an actual root like in e.g.
btrfs_find_create_tree_block.
Signed-off-by: Jeff Mahoney <jeffm@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'fs/btrfs/disk-io.c')
-rw-r--r-- | fs/btrfs/disk-io.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c index 8e838b1cc806..ff2362dca91a 100644 --- a/fs/btrfs/disk-io.c +++ b/fs/btrfs/disk-io.c | |||
@@ -1146,7 +1146,7 @@ struct extent_buffer *btrfs_find_tree_block(struct btrfs_fs_info *fs_info, | |||
1146 | struct extent_buffer *btrfs_find_create_tree_block(struct btrfs_root *root, | 1146 | struct extent_buffer *btrfs_find_create_tree_block(struct btrfs_root *root, |
1147 | u64 bytenr) | 1147 | u64 bytenr) |
1148 | { | 1148 | { |
1149 | if (btrfs_test_is_dummy_root(root)) | 1149 | if (btrfs_is_testing(root->fs_info)) |
1150 | return alloc_test_extent_buffer(root->fs_info, bytenr, | 1150 | return alloc_test_extent_buffer(root->fs_info, bytenr, |
1151 | root->nodesize); | 1151 | root->nodesize); |
1152 | return alloc_extent_buffer(root->fs_info, bytenr); | 1152 | return alloc_extent_buffer(root->fs_info, bytenr); |
@@ -1330,7 +1330,6 @@ struct btrfs_root *btrfs_alloc_dummy_root(struct btrfs_fs_info *fs_info, | |||
1330 | /* We don't use the stripesize in selftest, set it as sectorsize */ | 1330 | /* We don't use the stripesize in selftest, set it as sectorsize */ |
1331 | __setup_root(nodesize, sectorsize, sectorsize, root, fs_info, | 1331 | __setup_root(nodesize, sectorsize, sectorsize, root, fs_info, |
1332 | BTRFS_ROOT_TREE_OBJECTID); | 1332 | BTRFS_ROOT_TREE_OBJECTID); |
1333 | set_bit(BTRFS_ROOT_DUMMY_ROOT, &root->state); | ||
1334 | root->alloc_bytenr = 0; | 1333 | root->alloc_bytenr = 0; |
1335 | 1334 | ||
1336 | return root; | 1335 | return root; |