[PATCH 1/2] common: add a _require_external_realtime_device helper

Christoph Hellwig <[email protected]>
Newsgroups org.kernel.vger.fstests,org.kernel.vger.linux-xfs
Message-ID <[email protected]>
Factor out the check for an RT device on an external section.

Signed-off-by: Christoph Hellwig <[email protected]>
---
 common/rc | 18 ++++++++++++------
 1 file changed, 12 insertions(+), 6 deletions(-)

diff --git a/common/rc b/common/rc
index 71d872881610..336441c7a522 100644
--- a/common/rc
+++ b/common/rc
@@ -2405,6 +2405,17 @@ _require_no_large_scratch_dev()
 	_notrun "Large filesystem testing in progress, skipped this test"
 }
 
+# require an external realtime device (excludes the internal RT device)
+_require_external_realtime_device()
+{
+	if [ "$USE_EXTERNAL" != "yes" ]; then
+		_notrun "External volumes not in use, skipped this test"
+	fi
+	if [ "$SCRATCH_RTDEV" = "" ]; then
+		_notrun "Realtime device required, skipped this test"
+	fi
+}
+
 # this test requires that a realtime subvolume is in use, and
 # that the kernel supports realtime as well.
 #
@@ -2412,12 +2423,7 @@ _require_realtime()
 {
 	local zone_type=`_zone_type $SCRATCH_DEV`
 	if [ "${zone_type}" = "none" ]; then
-		if [ "$USE_EXTERNAL" != "yes" ]; then
-			_notrun "External volumes not in use, skipped this test"
-		fi
-		if [ "$SCRATCH_RTDEV" = "" ]; then
-			_notrun "Realtime device required, skipped this test"
-		fi
+		_require_external_realtime_device
 	fi
 }
 
-- 
2.53.0
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.