diff mbox series

[V2,2/5] common/xfs: Add function to detect support for metadump v2

Message ID 20240109102054.1668192-3-chandanbabu@kernel.org (mailing list archive)
State New, archived
Headers show
Series Add support for testing XFS metadump v2 | expand

Commit Message

Chandan Babu R Jan. 9, 2024, 10:20 a.m. UTC
This commit defines a new function to help detect support for metadump v2.

Signed-off-by: Chandan Babu R <chandanbabu@kernel.org>
---
 common/xfs | 6 ++++++
 1 file changed, 6 insertions(+)

Comments

Darrick J. Wong Jan. 9, 2024, 4:49 p.m. UTC | #1
On Tue, Jan 09, 2024 at 03:50:44PM +0530, Chandan Babu R wrote:
> This commit defines a new function to help detect support for metadump v2.
> 
> Signed-off-by: Chandan Babu R <chandanbabu@kernel.org>
> ---
>  common/xfs | 6 ++++++
>  1 file changed, 6 insertions(+)
> 
> diff --git a/common/xfs b/common/xfs
> index 38094828..fc744489 100644
> --- a/common/xfs
> +++ b/common/xfs
> @@ -698,6 +698,12 @@ _xfs_mdrestore() {
>  	$XFS_MDRESTORE_PROG $options "${metadump}" "${device}"
>  }
>  
> +_scratch_metadump_v2_supported()

/me wonders if the "_scratch" prefix is really warranted here since
metadump v2 support is a property of the tool, not the scratch fs.
OTOH xfs_db won't give you subcommand help without passing in a
filesystem and we probably don't want to force-feed it $TEST_DEV so
if zorro doesn't have any objections,

Reviewed-by: Darrick J. Wong <djwong@kernel.org>

--D

> +{
> +	$XFS_DB_PROG -c "help metadump" $SCRATCH_DEV | \
> +		grep -q "Metadump version to be used"
> +}
> +
>  # Snapshot the metadata on the scratch device
>  _scratch_xfs_metadump()
>  {
> -- 
> 2.43.0
> 
>
diff mbox series

Patch

diff --git a/common/xfs b/common/xfs
index 38094828..fc744489 100644
--- a/common/xfs
+++ b/common/xfs
@@ -698,6 +698,12 @@  _xfs_mdrestore() {
 	$XFS_MDRESTORE_PROG $options "${metadump}" "${device}"
 }
 
+_scratch_metadump_v2_supported()
+{
+	$XFS_DB_PROG -c "help metadump" $SCRATCH_DEV | \
+		grep -q "Metadump version to be used"
+}
+
 # Snapshot the metadata on the scratch device
 _scratch_xfs_metadump()
 {