test $(_xfs_bmapx_find cow $testdir/file3 delalloc) -gt 0 || \
echo "Expected to find a delalloc CoW extent"
echo "Shared data extents:"
-test $(_xfs_bmapx_find data $testdir/file3 '100000$') -gt 0 || \
+test $(_xfs_bmapx_find data $testdir/file3 -E '10[01]{4}$') -gt 0 || \
echo "Expected to find a shared data extent"
echo "Unwritten data extents:"
-test $(_xfs_bmapx_find data $testdir/file3 '10000$') -gt 0 || \
+test $(_xfs_bmapx_find data $testdir/file3 -E '1[01]{4}$') -gt 0 || \
echo "Expected to find an unwritten data extent"
echo "Hole data extents:"
test $(_xfs_bmapx_find data $testdir/file3 hole) -gt 0 || \
echo "Expected to find a hole data extent"
echo "Regular data extents:"
-test $(_xfs_bmapx_find data $testdir/file3 '000000$') -gt 0 || \
+test $(_xfs_bmapx_find data $testdir/file3 -E '00[01]{4}$') -gt 0 || \
echo "Expected to find a regular data extent"
sync
test $(_xfs_bmapx_find cow $testdir/file3 delalloc ) -eq 0 || \
echo "Expected to find zero delalloc CoW extent"
echo "Shared data extents:"
-test $(_xfs_bmapx_find data $testdir/file3 '100000$') -gt 0 || \
+test $(_xfs_bmapx_find data $testdir/file3 -E '10[01]{4}$') -gt 0 || \
echo "Expected to find a shared data extent"
echo "Unwritten data extents:"
-test $(_xfs_bmapx_find data $testdir/file3 '10000$') -gt 0 || \
+test $(_xfs_bmapx_find data $testdir/file3 -E '1[01]{4}$') -gt 0 || \
echo "Expected to find an unwritten data extent"
echo "Hole data extents:"
test $(_xfs_bmapx_find data $testdir/file3 hole) -gt 0 || \
echo "Expected to find a hole data extent"
echo "Regular data extents:"
-test $(_xfs_bmapx_find data $testdir/file3 '000000$') -gt 0 || \
+test $(_xfs_bmapx_find data $testdir/file3 -E '00[01]{4}$') -gt 0 || \
echo "Expected to find a regular data extent"
_scratch_cycle_mount
md5sum $testdir/file2 | _filter_scratch
echo "Unwritten data extents"
-test $(_xfs_bmapx_find data $testdir/file1 '10000$') -gt 0 || \
+test $(_xfs_bmapx_find data $testdir/file1 -E '1[01]{4}$') -gt 0 || \
echo "Expected to find an unwritten file1 extent"
echo "Shared data extents"
-test $(_xfs_bmapx_find data $testdir/file1 '100000$') -gt 0 || \
+test $(_xfs_bmapx_find data $testdir/file1 -E '10[01]{4}$') -gt 0 || \
echo "Expected to find a shared data extent"
echo "Hole data extents"
test $(_xfs_bmapx_find data $testdir/file2 'hole') -gt 0 || \
echo "Expected to find a hole data extent"
echo "Shared data extents"
-test $(_xfs_bmapx_find data $testdir/file2 '100000$') -gt 0 || \
+test $(_xfs_bmapx_find data $testdir/file2 -E '10[01]{4}$') -gt 0 || \
echo "Expected to find a shared data extent"
echo "Hole cow extents"
echo "Check bmap and fsmap" | tee -a $seqres.full
cat $TEST_DIR/bmap | while read ext offrange colon blockrange ag agrange total crap; do
- qstr="^[[:space:]]*[0-9]*:[[:space:]]*[0-9]*:[0-9]*[[:space:]]*${blockrange} :[[:space:]]*${ino}[[:space:]]*${offrange}[[:space:]]*${ag}[[:space:]]*${agrange}[[:space:]]*${total}$"
+ qstr="^[[:space:]]*[0-9]*:[[:space:]]*[0-9]*:[0-9]*[[:space:]]*${blockrange} :[[:space:]]*${ino}[[:space:]]*${offrange}[[:space:]]*${ag}[[:space:]]*${agrange}[[:space:]]*${total}(| [01]*)$"
echo "${qstr}" >> $seqres.full
grep "${qstr}" $TEST_DIR/fsmap >> $seqres.full
- found=$(grep -c "${qstr}" $TEST_DIR/fsmap)
+ found=$(grep -E -c "${qstr}" $TEST_DIR/fsmap)
test $found -eq 1 || echo "Unexpected output for offset ${offrange}."
done
echo "Check f1 bmap and fsmap" | tee -a $seqres.full
cat $TEST_DIR/bmap | while read ext offrange colon blockrange ag agrange total crap; do
- qstr="^[[:space:]]*[0-9]*:[[:space:]]*[0-9]*:[0-9]*[[:space:]]*${blockrange} :[[:space:]]*${ino}[[:space:]]*${offrange}[[:space:]]*${ag}[[:space:]]*${agrange}[[:space:]]*${total} 0100000$"
+ qstr="^[[:space:]]*[0-9]*:[[:space:]]*[0-9]*:[0-9]*[[:space:]]*${blockrange} :[[:space:]]*${ino}[[:space:]]*${offrange}[[:space:]]*${ag}[[:space:]]*${agrange}[[:space:]]*${total} 010[01]{4}$"
echo "${qstr}" >> $seqres.full
grep "${qstr}" $TEST_DIR/fsmap >> $seqres.full
- found=$(grep -c "${qstr}" $TEST_DIR/fsmap)
+ found=$(grep -E -c "${qstr}" $TEST_DIR/fsmap)
test $found -eq 1 || echo "Unexpected output for offset ${offrange}."
done
echo "Check f2 bmap and fsmap" | tee -a $seqres.full
cat $TEST_DIR/bmap | while read ext offrange colon blockrange ag agrange total crap; do
- qstr="^[[:space:]]*[0-9]*:[[:space:]]*[0-9]*:[0-9]*[[:space:]]*${blockrange} :[[:space:]]*${ino}[[:space:]]*${offrange}[[:space:]]*${ag}[[:space:]]*${agrange}[[:space:]]*${total} 0100000$"
+ qstr="^[[:space:]]*[0-9]*:[[:space:]]*[0-9]*:[0-9]*[[:space:]]*${blockrange} :[[:space:]]*${ino}[[:space:]]*${offrange}[[:space:]]*${ag}[[:space:]]*${agrange}[[:space:]]*${total} 010[01]{4}$"
echo "${qstr}" >> $seqres.full
grep "${qstr}" $TEST_DIR/fsmap >> $seqres.full
- found=$(grep -c "${qstr}" $TEST_DIR/fsmap)
+ found=$(grep -E -c "${qstr}" $TEST_DIR/fsmap)
test $found -eq 1 || echo "Unexpected output for offset ${offrange}."
done