btrfs: selftests: Add support for dummy devices
authorNikolay Borisov <nborisov@suse.com>
Tue, 19 Nov 2019 12:05:51 +0000 (14:05 +0200)
committerDavid Sterba <dsterba@suse.com>
Thu, 23 Jan 2020 16:24:34 +0000 (17:24 +0100)
commitb3ad2c17fd80f2db3b824c28691adaaa4ffa2fc4
treefeecec19b993bf7e11b001766d14d60adc1a6793
parent96a14336bd8fc13cc3db036a5745acdf3bc185f4
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>
fs/btrfs/tests/btrfs-tests.c
fs/btrfs/tests/btrfs-tests.h