common/fuzzy: if the fuzz verb is random, keep fuzzing until we get a new value
[xfstests-dev.git] / common / punch
index 43f04c2dc3dca5bd8573abfd801f12e056189bac..c4ed26192a2219e232202ecda9486e55a432f90d 100644 (file)
@@ -218,6 +218,23 @@ _filter_fiemap()
        _coalesce_extents
 }
 
+_filter_fiemap_flags()
+{
+       $AWK_PROG '
+               $3 ~ /hole/ {
+                       print $1, $2, $3;
+                       next;
+               }
+               $5 ~ /0x[[:xdigit:]]*8[[:xdigit:]][[:xdigit:]]/ {
+                       print $1, $2, "unwritten";
+                       next;
+               }
+               $5 ~ /0x[[:xdigit:]]+/ {
+                       print $1, $2, $5;
+               }' |
+       _coalesce_extents
+}
+
 # Filters fiemap output to only print the 
 # file offset column and whether or not
 # it is an extent or a hole
@@ -567,7 +584,7 @@ _test_generic_punch()
        if [ "$remove_testfile" ]; then
                rm -f $testfile
        fi
-       block_size=`get_block_size $TEST_DIR`
+       block_size=`_get_block_size $TEST_DIR`
        $XFS_IO_PROG -f -c "truncate $block_size" \
                -c "pwrite 0 $block_size" $sync_cmd \
                -c "$zero_cmd 128 128" \