]> www.infradead.org Git - users/hch/xfstests-dev.git/commitdiff
xfs: add a _scratch_require_xfs_scrub helper
authorChristoph Hellwig <hch@lst.de>
Thu, 11 Jan 2024 14:10:48 +0000 (15:10 +0100)
committerChristoph Hellwig <hch@lst.de>
Fri, 12 Jan 2024 05:02:43 +0000 (06:02 +0100)
Add a helper to call _supports_xfs_scrub with $SCRATCH_MNT and
$SCRATCH_DEV.

Signed-off-by: Christoph Hellwig <hch@lst.de>
common/xfs
tests/xfs/556
tests/xfs/716

index 4e54d75cc7ddd7c58cebf000ec88c8dfb3995a87..b71ba8d1e78e2039809d277d5e83927af1312754 100644 (file)
@@ -662,6 +662,13 @@ _supports_xfs_scrub()
        return 0
 }
 
+# Does the scratch file system support scrub?
+_scratch_require_xfs_scrub()
+{
+       _supports_xfs_scrub $SCRATCH_MNT $SCRATCH_DEV || \
+               _notrun "Scrub not supported"
+}
+
 # Save a snapshot of a corrupt xfs filesystem for later debugging.
 _xfs_metadump() {
        local metadump="$1"
index 061d8d57233092b888d97ff0942a6b99b731a937..6be9932736b726a9e7003a69edd1c4853184917a 100755 (executable)
@@ -40,7 +40,7 @@ _scratch_mkfs >> $seqres.full
 _dmerror_init
 _dmerror_mount >> $seqres.full 2>&1
 
-_supports_xfs_scrub $SCRATCH_MNT $SCRATCH_DEV || _notrun "Scrub not supported"
+_scratch_require_xfs_scrub
 
 # Write a file with 4 file blocks worth of data
 victim=$SCRATCH_MNT/a
index 930a0ecbb794addf1bcd3de899ded60bde04e64c..4cfb27f1867d44824fa6a0ecb72bde4f597b840a 100755 (executable)
@@ -31,7 +31,7 @@ _require_test_program "punch-alternating"
 _scratch_mkfs > $tmp.mkfs
 _scratch_mount
 
-_supports_xfs_scrub $SCRATCH_MNT $SCRATCH_DEV || _notrun "Scrub not supported"
+_scratch_require_xfs_scrub
 
 # Force data device extents so that we can create a file with the exact bmbt
 # that we need regardless of rt configuration.