common/xfs: refactor xfs_scrub presence testing
[xfstests-dev.git] / tests / generic / 453
index bda1112984a8ed6e39f7c72362b7070403cfaf40..fc079783cb6c361272435cbf6b839df537f27a19 100755 (executable)
@@ -136,10 +136,8 @@ echo "Test XFS online scrub, if applicable"
 
 # Only run this on xfs if xfs_scrub is available and has the unicode checker
 check_xfs_scrub() {
-       # Ignore non-XFS fs or no scrub program...
-       if [ "${FSTYP}" != "xfs" ] || [ ! -x "${XFS_SCRUB_PROG}" ]; then
-               return 1
-       fi
+       [ "$FSTYP" == "xfs" ] || return 1
+       _supports_xfs_scrub "$SCRATCH_MNT" "$SCRATCH_DEV" || return 1
 
        # We only care if xfs_scrub has unicode string support...
        if ! type ldd > /dev/null 2>&1 || \
@@ -147,12 +145,6 @@ check_xfs_scrub() {
                return 1
        fi
 
-       # Does the ioctl work?
-       if $XFS_IO_PROG -x -c "scrub probe 0" $SCRATCH_MNT 2>&1 | \
-          grep -q "Inappropriate ioctl"; then
-               return 1
-       fi
-
        return 0
 }