From 7a2fe2c2f7be4982cdbbb882e1802966fef448f5 Mon Sep 17 00:00:00 2001 From: Hans Holmberg Date: Fri, 27 Mar 2026 13:34:28 +0100 Subject: [PATCH] xfs/647: turn rt dev block device lookup into a common helper Turn the logic figuring out on which block device the rt data is stored on into a common helper. Signed-off-by: Hans Holmberg Reviewed-by: Christoph Hellwig Reviewed-by: Darrick J. Wong Signed-off-by: Zorro Lang --- common/xfs | 11 +++++++++++ tests/xfs/647 | 10 +--------- 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/common/xfs b/common/xfs index 7d7afbb5..a41d8880 100644 --- a/common/xfs +++ b/common/xfs @@ -737,6 +737,17 @@ _xfs_metadump_supports_rt() $XFS_METADUMP_PROG --help 2>&1 | grep -q -- '-r rtdev' } +# What block device is rt data located on for scratch? +_xfs_get_scratch_rtdev_bdev() +{ + # Is the rt dev internal or not? + if [ -z "$SCRATCH_RTDEV" ]; then + echo "$SCRATCH_DEV" + else + echo "$SCRATCH_RTDEV" + fi +} + # Snapshot the metadata on the scratch device _scratch_xfs_metadump() { diff --git a/tests/xfs/647 b/tests/xfs/647 index 76959b28..0ef340a1 100755 --- a/tests/xfs/647 +++ b/tests/xfs/647 @@ -17,15 +17,7 @@ _begin_fstest auto quick zone _require_scratch _require_realtime -# -# Figure out if the rt section is internal or not -# -if [ -z "$SCRATCH_RTDEV" ]; then - zdev=$SCRATCH_DEV -else - zdev=$SCRATCH_RTDEV -fi - +zdev="$(_xfs_get_scratch_rtdev_bdev)" _require_zoned_device $zdev _require_command "$BLKZONE_PROG" blkzone -- 2.47.3