]> www.infradead.org Git - users/hch/xfstests-dev.git/commitdiff
xfs: add a _require_scratch_xfs_scrub helper
authorChristoph Hellwig <hch@lst.de>
Fri, 12 Jan 2024 05:08:31 +0000 (06:08 +0100)
committerZorro Lang <zlang@kernel.org>
Sun, 14 Jan 2024 12:39:09 +0000 (20:39 +0800)
Add a helper to call _supports_xfs_scrub with $SCRATCH_MNT and
$SCRATCH_DEV.

[zlang: rename the _scratch_require_xxx to _require_scratch_xxx]

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Darrick J. Wong <djwong@kernel.org>
Reviewed-by: Zorro Lang <zlang@redhat.com>
Signed-off-by: Zorro Lang <zlang@kernel.org>
common/xfs
tests/xfs/556
tests/xfs/716

index 4e54d75cc7ddd7c58cebf000ec88c8dfb3995a87..f23e1e918788153ac0d2da41bc258fcbf038092c 100644 (file)
@@ -662,6 +662,13 @@ _supports_xfs_scrub()
        return 0
 }
 
+# Does the scratch file system support scrub?
+_require_scratch_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..2f8cad1a2acb3543a26e8d78da1c3396c8dcdf1a 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"
+_require_scratch_xfs_scrub
 
 # Write a file with 4 file blocks worth of data
 victim=$SCRATCH_MNT/a
index 930a0ecbb794addf1bcd3de899ded60bde04e64c..ef0af45345ff9bbb5f549999878699b3a02ce04e 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"
+_require_scratch_xfs_scrub
 
 # Force data device extents so that we can create a file with the exact bmbt
 # that we need regardless of rt configuration.