_mount -t $FSTYP $TEST_OPTIONS $TEST_FS_MOUNT_OPTS $SELINUX_MOUNT_OPTIONS $* $TEST_DEV $TEST_DIR
}
+_test_unmount()
+{
+ $UMOUNT_PROG $TEST_DEV
+}
+
_test_remount()
{
- $UMOUNT_PROG $TEST_DEV
+ _test_unmount
_test_mount
}
$SCRATCH_MNT/.use_space 2>&1 > /dev/null
export NUM_SPACE_FILES=1
status=$?
- umount $SCRATCH_MNT
+ _scratch_unmount
if [ $status -ne 0 ]; then
echo "large file prealloc failed"
cat $tmp_dir/mnt.err >&2
fi
export NUM_SPACE_FILES=$nfiles
- umount $SCRATCH_MNT
+ _scratch_unmount
if [ $status -ne 0 ]; then
echo "large file prealloc failed"
cat $tmp_dir/mnt.err >&2
exit 1
fi
# and then unmount it
- if ! $UMOUNT_PROG $SCRATCH_DEV
+ if ! _scratch_unmount
then
echo "failed to unmount $SCRATCH_DEV"
exit 1
_scratch_mkfs_xfs -m crc=1 >/dev/null 2>&1
_scratch_mount >/dev/null 2>&1 \
|| _notrun "Kernel doesn't support crc feature"
- umount $SCRATCH_MNT
+ _scratch_unmount
}
# this test requires the ext4 kernel support crc feature on scratch device
dumpe2fs -h $SCRATCH_DEV 2> /dev/null | grep -q metadata_csum || _notrun "metadata_csum not supported by this filesystem"
_scratch_mount >/dev/null 2>&1 \
|| _notrun "Kernel doesn't support metadata_csum feature"
- umount $SCRATCH_MNT
+ _scratch_unmount
}
# this test requires the xfs kernel support crc feature on scratch device
_scratch_mount >/dev/null 2>&1 \
|| _notrun "Kernel doesn't support crc feature"
xfs_info $SCRATCH_MNT | grep -q 'crc=1' || _notrun "crc feature not supported by this filesystem"
- umount $SCRATCH_MNT
+ _scratch_unmount
}
# this test requires the bigalloc feature to be available in mkfs.ext4
$MKFS_EXT4_PROG -F -O bigalloc $SCRATCH_DEV 512m >/dev/null 2>&1
_scratch_mount >/dev/null 2>&1 \
|| _notrun "Ext4 kernel doesn't support bigalloc feature"
- umount $SCRATCH_MNT
+ _scratch_unmount
}
# this test requires the finobt feature to be available in mkfs.xfs
_scratch_mkfs_xfs -m crc=1,finobt=1 >/dev/null 2>&1
_scratch_mount >/dev/null 2>&1 \
|| _notrun "Kernel doesn't support finobt feature"
- umount $SCRATCH_MNT
+ _scratch_unmount
}
# this test requires xfs sysfs attribute support
_scratch_mkfs_xfs -m crc=1 -i sparse > /dev/null 2>&1
_scratch_mount >/dev/null 2>&1 \
|| _notrun "kernel does not support sparse inodes"
- umount $SCRATCH_MNT
+ _scratch_unmount
}
# this test requires that external log/realtime devices are not in use
_scratch_mount >/dev/null 2>&1 \
|| _notrun "Kernel doesn't support meta_uuid feature"
- umount $SCRATCH_MNT
+ _scratch_unmount
}
_require_btrfs_dev_del_by_devid()