xfs: fix $XFS_DB_PROG usage
[xfstests-dev.git] / common / rc
index 73387790b3dae2e62d3d8a804e964bd51bc9008b..c3da064a34033d96d7078cf38df7021deb0a7f96 100644 (file)
--- a/common/rc
+++ b/common/rc
@@ -1106,6 +1106,11 @@ _scratch_xfs_db_options()
     echo $SCRATCH_OPTIONS $* $SCRATCH_DEV
 }
 
+_scratch_xfs_db()
+{
+       $XFS_DB_PROG "$@" $(_scratch_xfs_db_options)
+}
+
 _scratch_xfs_logprint()
 {
     SCRATCH_OPTIONS=""
@@ -2083,7 +2088,7 @@ _require_xfs_db_command()
        fi
        command=$1
 
-       $XFS_DB_PROG -x -c "help" $SCRATCH_DEV | grep $command > /dev/null || \
+       _scratch_xfs_db -x -c "help" | grep $command > /dev/null || \
                _notrun "xfs_db $command support is missing"
 }
 
@@ -3367,11 +3372,11 @@ _require_meta_uuid()
        # This will create a crc fs on $SCRATCH_DEV
        _require_xfs_crc
 
-       $XFS_DB_PROG -x -c "uuid restore" $SCRATCH_DEV 2>&1 \
+       _scratch_xfs_db -x -c "uuid restore" 2>&1 \
           | grep -q "invalid UUID\|supported on V5 fs" \
           && _notrun "Userspace doesn't support meta_uuid feature"
 
-       $XFS_DB_PROG -x -c "uuid generate" $SCRATCH_DEV >/dev/null 2>&1
+       _scratch_xfs_db -x -c "uuid generate" >/dev/null 2>&1
 
        _scratch_mount >/dev/null 2>&1 \
           || _notrun "Kernel doesn't support meta_uuid feature"