summaryrefslogtreecommitdiff
path: root/common/xfs
diff options
context:
space:
mode:
authorDarrick J. Wong <djwong@kernel.org>2022-12-13 11:45:20 -0800
committerZorro Lang <zlang@kernel.org>2022-12-17 18:38:19 +0800
commit830b45aa636f1816e161f05177a41c1ec3625665 (patch)
tree28f9149124e8ab688635cd18bd88690b0e26a2ea /common/xfs
parent538abf799424a769f2f546790b12508932838586 (diff)
common/xfs: create a helper for restoring metadumps to the scratch devs
Refactor the open-coded $XFS_MDRESTORE_PROG calls into a proper _scratch_xfs_mdrestore helper. Signed-off-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/xfs')
-rw-r--r--common/xfs9
1 files changed, 9 insertions, 0 deletions
diff --git a/common/xfs b/common/xfs
index 938c5826..14be4406 100644
--- a/common/xfs
+++ b/common/xfs
@@ -660,6 +660,15 @@ _scratch_xfs_metadump()
_xfs_metadump "$metadump" "$SCRATCH_DEV" "$logdev" nocompress "$@"
}
+# Restore snapshotted metadata on the scratch device
+_scratch_xfs_mdrestore()
+{
+ local metadump=$1
+ shift
+
+ _xfs_mdrestore "$metadump" "$SCRATCH_DEV" "$@"
+}
+
# run xfs_check and friends on a FS.
_check_xfs_filesystem()
{