local filename=punch_test_file
cd /
- umount $SCRATCH_MNT >/dev/null 2>&1
+ _scratch_unmount >/dev/null 2>&1
_scratch_mkfs_xfs -bsize=$blksize >/dev/null 2>&1 \
|| _fail "mkfs failed"
_filter_fiemap()
{
- awk --posix '
+ $AWK_PROG '
$3 ~ /hole/ {
print $1, $2, $3;
next;
}
- $5 ~ /0x[[:xdigit:]]*8[[:xdigit:]]{2}/ {
+ $5 ~ /0x[[:xdigit:]]*8[[:xdigit:]][[:xdigit:]]/ {
print $1, $2, "unwritten";
next;
}
_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
_filter_hole_fiemap()
{
- awk --posix '
+ $AWK_PROG '
$3 ~ /hole/ {
print $1, $2, $3;
next;
_coalesce_extents
}
+# 10000 Unwritten preallocated extent
+# 01000 Doesn't begin on stripe unit
+# 00100 Doesn't end on stripe unit
+# 00010 Doesn't begin on stripe width
+# 00001 Doesn't end on stripe width
_filter_bmap()
{
awk '
print $1, $2, $3;
next;
}
- $7 ~ /10000/ {
+ $7 ~ /1[01][01][01][01]/ {
print $1, $2, "unwritten";
next;
}
- $7 ~ /00000/ {
+ $7 ~ /0[01][01][01][01]/ {
print $1, $2, "data"
}' |
_coalesce_extents
return
fi
+ # If zero_cmd is finsert, don't check unaligned offsets
+ if [ "$zero_cmd" == "finsert" ]; then
+ return
+ fi
+
echo " 16. data -> cache cold ->hole"
if [ "$remove_testfile" ]; then
rm -f $testfile
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" \