diff options
author | Nikolay Borisov <nborisov@suse.com> | 2019-11-19 14:05:51 +0200 |
---|---|---|
committer | David Sterba <dsterba@suse.com> | 2020-01-23 17:24:34 +0100 |
commit | b3ad2c17fd80f2db3b824c28691adaaa4ffa2fc4 (patch) | |
tree | feecec19b993bf7e11b001766d14d60adc1a6793 /fs/btrfs/tests/btrfs-tests.h | |
parent | 96a14336bd8fc13cc3db036a5745acdf3bc185f4 (diff) |
btrfs: selftests: Add support for dummy devices
Add basic infrastructure to create and link dummy btrfs_devices. This
will be used in the pending btrfs_rmap_block test which deals with
the block groups.
Calling btrfs_alloc_dummy_device will link the newly created device to
the passed fs_info and the test framework will free them once the test
is finished.
Signed-off-by: Nikolay Borisov <nborisov@suse.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'fs/btrfs/tests/btrfs-tests.h')
-rw-r--r-- | fs/btrfs/tests/btrfs-tests.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/fs/btrfs/tests/btrfs-tests.h b/fs/btrfs/tests/btrfs-tests.h index 9e52527357d8..7a2d7ffbe30e 100644 --- a/fs/btrfs/tests/btrfs-tests.h +++ b/fs/btrfs/tests/btrfs-tests.h @@ -46,6 +46,7 @@ btrfs_alloc_dummy_block_group(struct btrfs_fs_info *fs_info, unsigned long lengt void btrfs_free_dummy_block_group(struct btrfs_block_group *cache); void btrfs_init_dummy_trans(struct btrfs_trans_handle *trans, struct btrfs_fs_info *fs_info); +struct btrfs_device *btrfs_alloc_dummy_device(struct btrfs_fs_info *fs_info); #else static inline int btrfs_run_sanity_tests(void) { |