From: Hans Holmberg Date: Fri, 27 Mar 2026 12:34:28 +0000 (+0100) Subject: xfs/647: turn rt dev block device lookup into a common helper X-Git-Tag: v2026.04.20~15 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=7a2fe2c2f7be4982cdbbb882e1802966fef448f5;p=xfstests-dev.git 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 --- 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