_dmthin_check_fs()
{
_unmount $SCRATCH_MNT > /dev/null 2>&1
- _check_scratch_fs $DMTHIN_VOL_DEV
+ OLD_SCRATCH_DEV=$SCRATCH_DEV
+ SCRATCH_DEV=$DMTHIN_VOL_DEV
+ _check_scratch_fs
+ SCRATCH_DEV=$OLD_SCRATCH_DEV
+ unset OLD_SCRATCH_DEV
}
# Set up a dm-thin device on $SCRATCH_DEV
esac
}
-_check_scratch_fs()
+# check the file system passed in as $1
+_check_dev_fs()
{
- local device=$SCRATCH_DEV
- [ $# -eq 1 ] && device=$1
+ local device=$1
case $FSTYP in
xfs)
- _check_xfs_scratch_fs $device
+ _check_xfs_filesystem $device "none" "none"
;;
udf)
_check_udf_filesystem $device $udf_fsize
esac
}
+# check the scratch file system
+_check_scratch_fs()
+{
+ case $FSTYP in
+ xfs)
+ _check_xfs_scratch_fs $SCRATCH_DEV
+ ;;
+ *)
+ _check_dev_fs $SCRATCH_DEV
+ ;;
+ esac
+}
+
_full_fstyp_details()
{
[ -z "$FSTYP" ] && FSTYP=xfs
# Deleting device 1 should work again after swapoff.
$BTRFS_UTIL_PROG device delete "$scratch_dev1" "$SCRATCH_MNT"
_scratch_unmount
-_check_scratch_fs "$scratch_dev2"
+_check_dev_fs "$scratch_dev2"
echo "Replace device"
_scratch_mkfs >> $seqres.full 2>&1
$BTRFS_UTIL_PROG replace start -fB "$scratch_dev1" "$scratch_dev2" "$SCRATCH_MNT" \
>> $seqres.full
_scratch_unmount
-_check_scratch_fs "$scratch_dev2"
+_check_dev_fs "$scratch_dev2"
# success, all done
status=0
_metadump_dev $DMERROR_DEV $seqres.scratch.final.md
echo "final scratch mount failed"
fi
- SCRATCH_RTDEV= SCRATCH_LOGDEV= _check_scratch_fs $loopimg
+ _check_dev_fs $loopimg
fi
# success, all done; let the test harness check the scratch fs
echo copy
$XFS_COPY_PROG $SCRATCH_DEV $copy_file >> $seqres.full
-_check_scratch_fs $copy_file
+_check_dev_fs $copy_file
echo recopy
$XFS_COPY_PROG $copy_file $SCRATCH_DEV >> $seqres.full