@@ -23,6 +23,7 @@ _supported_fs xfs
_require_scratch_nocheck # check complains about single AG fs
_require_xfs_io_command "fpunch"
_require_command $UUIDGEN_PROG uuidgen
+_require_test_program "punch-alternating"
# Disable the scratch rt device to avoid test failures relating to the rt
# bitmap consuming all the free space in our small data device.
@@ -30,7 +31,8 @@ unset SCRATCH_RTDEV
# Create a small fs with a large directory block size. We want to fill up the fs
# quickly and then create multi-fsb dirblocks over fragmented free space.
-_scratch_mkfs_xfs -d size=20m -n size=64k >> $seqres.full 2>&1
+_scratch_mkfs_xfs -d size=100m -n size=64k >> $seqres.full 2>&1 || \
+ _notrun 'could not format tiny scratch fs'
_scratch_mount
# Fill a source directory with many largish-named files. 1k uuid-named entries
@@ -49,10 +51,7 @@ done
$XFS_IO_PROG -xc "resblks 16" $SCRATCH_MNT >> $seqres.full 2>&1
dd if=/dev/zero of=$SCRATCH_MNT/file bs=4k >> $seqres.full 2>&1
$XFS_IO_PROG -c "fsync" $SCRATCH_MNT/file >> $seqres.full 2>&1
-size=`_get_filesize $SCRATCH_MNT/file`
-for i in $(seq 0 8192 $size); do
- $XFS_IO_PROG -c "fpunch $i 4k" $SCRATCH_MNT/file >> $seqres.full 2>&1
-done
+$here/src/punch-alternating $SCRATCH_MNT/file
# Replicate the src dir several times into fragmented free space. After one or
# two dirs, we should have nothing but non-contiguous directory blocks.