-e "/.use_space/d"
}
+_filter_testdir_and_scratch()
+{
+ # filter both $TEST_DIR and $SCRATCH_MNT, but always filter the longer
+ # string first if the other string is a substring of the first one
+ if echo "$TEST_DIR" | grep -q "$SCRATCH_MNT"; then
+ _filter_test_dir | _filter_scratch
+ else
+ _filter_scratch | _filter_test_dir
+ fi
+}
+
# Turn any device in the scratch pool into SCRATCH_DEV
_filter_scratch_pool()
{
{
# Long dev name might be split onto its own line; last
# seds remove that newline if present
- _filter_scratch | _filter_test_dir | _filter_spaces | \
+ _filter_testdir_and_scratch | _filter_spaces | \
sed -e 'N;s/SCRATCH_DEV\n/SCRATCH_DEV/g' | \
sed -e 'N;s/TEST_DEV\n/TEST_DEV/g'
}
_scratch_mount
$XFS_IO_PROG -f -c 'pwrite -S 0x61 0 9000' $SCRATCH_MNT/original >> $seqres.full
-_filter_testdirs()
-{
- _filter_test_dir | _filter_scratch
-}
-
_create_reflinks()
{
# auto reflink, should fall back to non-reflink
rm -rf $2
echo "reflink=auto:"
cp --reflink=auto $1 $2
- md5sum $1 | _filter_testdirs
- md5sum $2 | _filter_testdirs
+ md5sum $1 | _filter_testdir_and_scratch
+ md5sum $2 | _filter_testdir_and_scratch
# always reflink, should fail outright
rm -rf $2
cp --reflink=always $1 $2 >> $seqres.full 2>&1 || echo "cp reflink failed"
# The failed target actually gets created by cp:
- ls $2 | _filter_testdirs
+ ls $2 | _filter_testdir_and_scratch
}
echo "test reflinks across different devices"
-e "s;$mpB;mpB;g" \
-e "s;$mpC;mpC;g" \
-e "s;$mpD;mpD;g" | \
- _filter_spaces | _filter_scratch | \
- _filter_test_dir | sort
+ _filter_spaces | _filter_testdir_and_scratch | sort
echo "======"
}
sed -e "s;$mpA;mpA;g" \
-e "s;$mpB;mpB;g" \
-e "s;$mpC;mpC;g" | \
- _filter_spaces | _filter_scratch | \
- _filter_test_dir | sort
+ _filter_spaces | _filter_testdir_and_scratch | sort
echo "======"
}
sed -e "s;$mpA;mpA;g" \
-e "s;$mpB;mpB;g" \
-e "s;$mpC;mpC;g" | \
- _filter_spaces | _filter_scratch | \
- _filter_test_dir | sort
+ _filter_spaces | _filter_testdir_and_scratch | sort
echo "======"
}