summaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2024-01-12 06:08:31 +0100
committerZorro Lang <zlang@kernel.org>2024-01-14 20:39:09 +0800
commite0864962b2d6553db6ce6942befd2764aa7d766a (patch)
tree853c99b92783e260c47e4dc6a35b4e736c811f53 /common
parent4d04485207fe6701f587e862336627f50a7add44 (diff)
xfs: add a _require_scratch_xfs_scrub helper
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>
Diffstat (limited to 'common')
-rw-r--r--common/xfs7
1 files changed, 7 insertions, 0 deletions
diff --git a/common/xfs b/common/xfs
index 4e54d75c..f23e1e91 100644
--- a/common/xfs
+++ b/common/xfs
@@ -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"