]> git-server-git.apps.pok.os.sepia.ceph.com Git - xfstests-dev.git/commitdiff
xfs/647: turn rt dev block device lookup into a common helper
authorHans Holmberg <hans.holmberg@wdc.com>
Fri, 27 Mar 2026 12:34:28 +0000 (13:34 +0100)
committerZorro Lang <zlang@kernel.org>
Wed, 1 Apr 2026 15:07:08 +0000 (23:07 +0800)
Turn the logic figuring out on which block device the rt data is stored on
into a common helper.

Signed-off-by: Hans Holmberg <hans.holmberg@wdc.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Darrick J. Wong <djwong@kernel.org>
Signed-off-by: Zorro Lang <zlang@kernel.org>
common/xfs
tests/xfs/647

index 7d7afbb51609516113dcef1298ecb21cdf78dc11..a41d8880d0274e651ed1421f1926893817a273bc 100644 (file)
@@ -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()
 {
index 76959b28c7790b09e76c4ecd51b066ba606be8f6..0ef340a14b072fdf0301fae598d5090ef01e48a0 100755 (executable)
@@ -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