_supported_fs btrfs
_supported_os Linux
_require_scratch_dev_pool 2
-_require_loadable_fs_module "btrfs"
+_require_btrfs_forget_or_module_loadable
_scratch_dev_pool_get 2
DEV2_SZ=`blockdev --getsize64 $DEV2`
# get min
-MAX_FS_SZ=`echo -e "$DEV1_SZ\n$DEV2_SZ" | sort | head -1`
+MAX_FS_SZ=`echo -e "$DEV1_SZ\n$DEV2_SZ" | sort -n | head -1`
# Need disks with more than 2G
if [ $MAX_FS_SZ -lt 2000000000 ]; then
_scratch_dev_pool_put
echo "clean btrfs ko" >> $seqres.full
# un-scan the btrfs devices
- _reload_fs_module "btrfs"
+ _btrfs_forget_or_module_reload
_mount -o degraded $DEV1 $SCRATCH_MNT >>$seqres.full 2>&1
cnt=$(( $COUNT/10 ))
dd if=/dev/urandom of="$SCRATCH_MNT"/tf1 bs=$bs count=$cnt \
echo
echo "run balance"
- _run_btrfs_util_prog balance start --full-balance -dconvert=raid1 \
- -mconvert=raid1 ${SCRATCH_MNT}
+ _run_btrfs_balance_start -dconvert=raid1 \
+ -mconvert=raid1 $SCRATCH_MNT >> $seqres.full
}
verify()
echo "unmount" >> $seqres.full
_scratch_unmount
- _reload_fs_module "btrfs"
+ _btrfs_forget_or_module_reload
_mount -o degraded $DEV2 $SCRATCH_MNT >>$seqres.full 2>&1
verify_checkpoint1=`md5sum $SCRATCH_MNT/tf1`
verify_checkpoint2=`md5sum $SCRATCH_MNT/tf2`