export MKFS_UDF_PROG="`set_prog_path mkudffs`"
export MKFS_BTRFS_PROG="`set_btrfs_mkfs_prog_path_with_opts`"
export MKFS_F2FS_PROG="`set_prog_path mkfs.f2fs`"
+ export DUMP_F2FS_PROG="`set_prog_path dump.f2fs`"
export BTRFS_UTIL_PROG="`set_prog_path btrfs`"
export BTRFS_SHOW_SUPER_PROG="`set_prog_path btrfs-show-super`"
export XFS_FSR_PROG="`set_prog_path xfs_fsr`"
| head | grep -q "<CLEAN>" || _fail "DIRTY LOG"
}
+_scratch_xfs_logstate()
+{
+ _scratch_xfs_logprint -t | tee -a $seqres.full | grep -q "<CLEAN>"
+ echo $?
+}
+
+_scratch_f2fs_logstate()
+{
+ $DUMP_F2FS_PROG $SCRATCH_DEV | tee -a $seqres.full | grep -q "unmount"
+ echo $?
+}
+
_print_logstate()
{
- _scratch_xfs_logprint -t | tee -a $seqres.full >$tmp.logprint
- if grep -q "<DIRTY>" $tmp.logprint; then
- echo "dirty log"
- fi
- if grep -q "<CLEAN>" $tmp.logprint; then
- echo "clean log"
+ case "$FSTYP" in
+ xfs)
+ dirty=$(_scratch_xfs_logstate)
+ ;;
+ f2fs)
+ dirty=$(_scratch_f2fs_logstate)
+ ;;
+ *)
+ ;;
+ esac
+
+ if [ $dirty -ne 0 ]; then
+ echo "dirty log"
+ else
+ echo "clean log"
fi
}
# otherwise presume it does support v2 logs...:)
}
+_require_logstate()
+{
+ case "$FSTYP" in
+ xfs)
+ if [ -z "$XFS_LOGPRINT_PROG" ]; then
+ _notrun "This test requires xfs_logprint utility."
+ fi
+ ;;
+ f2fs)
+ if [ -z "$DUMP_F2FS_PROG" ]; then
+ _notrun "This test requires dump.f2fs utility."
+ fi
+ ;;
+ *)
+ _notrun "$FSTYP does not support log state probing."
+ ;;
+ esac
+}
# make sure this script returns success
/bin/true