modprobe btrfs > /dev/null 2>&1
[ -e /sys/fs/btrfs/features/$feat ] || \
_notrun "Feature $feat not supported by the available btrfs version"
-
- if [ $feat = "raid56" ]; then
- # Zoned btrfs only supports SINGLE profile
- _require_non_zoned_device "${SCRATCH_DEV}"
- fi
}
_require_btrfs_fs_sysfs()
return
fi
+ modprobe btrfs > /dev/null 2>&1
+
local unsupported=()
if [ "$1" == "replace" ]; then
# We can't do replace with these profiles because they
)
fi
+ if [ ! -e /sys/fs/btrfs/features/raid56 ]; then
+ # We don't have raid56 compiled in, remove them
+ unsupported+=(
+ "raid5"
+ "raid6"
+ )
+ fi
+
if _scratch_btrfs_is_zoned; then
# Zoned btrfs only supports SINGLE profile
unsupported+=(
_mkfs_dev -fq --uuid $fsid --device-uuid $uuid $dev2
}
+
+_check_btrfs_raid_type()
+{
+ _btrfs_get_profile_configs
+ if [[ ! "${_btrfs_profile_configs[@]}" =~ "$1" ]]; then
+ return 1
+ fi
+ return 0
+}
+
+_require_btrfs_raid_type()
+{
+ _check_btrfs_raid_type $1 || \
+ _notrun "$1 isn't supported by the profile config or scratch device"
+}
_require_scratch_dev_pool 3
_test_unmount
_require_btrfs_forget_or_module_loadable
-_require_btrfs_fs_feature raid56
+_require_btrfs_raid_type raid5
_scratch_dev_pool_get 3
_require_scratch
_require_scratch_dev_pool 4
_require_odirect
-_require_btrfs_fs_feature raid56
+_require_btrfs_raid_type raid5
+_require_btrfs_raid_type raid6
_scratch_dev_pool_get 4
_require_btrfs_no_nodatacow
_require_scratch_dev_pool 4
_require_btrfs_command inspect-internal dump-tree
-_require_btrfs_fs_feature raid56
+_require_btrfs_raid_type raid6
get_physical()
{
_require_btrfs_no_nodatacow
_require_scratch_dev_pool 4
_require_btrfs_command inspect-internal dump-tree
-_require_btrfs_fs_feature raid56
+_require_btrfs_raid_type raid5
get_physical()
{