Don't open-code _notrun checks for the rmapbt, just use the helper.
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Eryu Guan <eguan@redhat.com>
_supported_os Linux
_supported_fs xfs
_require_scratch
+_require_xfs_scratch_rmapbt
_require_xfs_io_command "falloc"
rm -f $seqres.full
_scratch_mkfs >/dev/null 2>&1
_scratch_mount >> $seqres.full
-is_rmap=$(xfs_info $SCRATCH_MNT | grep -c "rmapbt=1")
-test $is_rmap -gt 0 || _notrun "rmap not supported on scratch fs"
-
testdir=$SCRATCH_MNT/test-$seq
blksz="$(stat -f $SCRATCH_MNT -c '%S')"
_supported_fs xfs
_require_cp_reflink
_require_scratch_reflink
+_require_xfs_scratch_rmapbt
_require_error_injection
_require_xfs_io_error_injection "rmap_finish_one"
_scratch_mkfs >/dev/null 2>&1
_scratch_mount >> $seqres.full
-is_rmap=$(xfs_info $SCRATCH_MNT | grep -c "rmapbt=1")
-test $is_rmap -gt 0 || _notrun "rmap not supported on scratch fs"
-
echo "Create files"
_pwrite_byte 0x66 0 $sz $SCRATCH_MNT/file1 >> $seqres.full
_cp_reflink $SCRATCH_MNT/file1 $SCRATCH_MNT/file2
_supported_os Linux
_supported_fs xfs
_require_scratch
+_require_xfs_scratch_rmapbt
_require_error_injection
_require_xfs_io_error_injection "rmap_finish_one"
_scratch_mkfs >/dev/null 2>&1
_scratch_mount >> $seqres.full
-is_rmap=$(xfs_info $SCRATCH_MNT | grep -c "rmapbt=1")
-test $is_rmap -gt 0 || _notrun "rmap not supported on scratch fs"
-
echo "Create files"
touch $SCRATCH_MNT/file1
_pwrite_byte 0x67 0 $sz $SCRATCH_MNT/file0 >> $seqres.full
_supported_fs xfs
_require_cp_reflink
_require_scratch_reflink
+_require_xfs_scratch_rmapbt
_require_xfs_io_error_injection "rmap_finish_one"
rm -f $seqres.full
_scratch_mkfs >/dev/null 2>&1
_scratch_mount >> $seqres.full
-is_rmap=$(xfs_info $SCRATCH_MNT | grep -c "rmapbt=1")
-test $is_rmap -gt 0 || _notrun "rmap not supported on scratch fs"
-
echo "Create files"
_pwrite_byte 0x66 0 $sz $SCRATCH_MNT/file1 >> $seqres.full
$XFS_IO_PROG -f -c "truncate $sz" $SCRATCH_MNT/file3 >> $seqres.full