@@ -275,30 +275,6 @@ mount_configfs() {
fi
}
-# Set scheduler of block device $1 to $2.
-set_scheduler() {
- local b=$1 p s=$2
-
- p=/sys/class/block/$b/queue/scheduler
- if [ -e "/sys/block/$b/mq" ]; then
- case "$s" in
- noop) s=none;;
- deadline) s=mq-deadline;;
- bfq) s=bfq;;
- esac
- else
- case "$s" in
- none) s=noop;;
- mq-deadline) s=deadline;;
- bfq-mq) s=bfq;;
- esac
- fi
- if ! echo "$s" > "$p"; then
- echo "Changing scheduler of $b from $(<"$p") into $s failed"
- return 1
- fi
-}
-
# Get a /dev/... path that points at dm device number $1. Set its I/O scheduler
# to $2 and its timeout to $3. The shell script that includes this file must
# define a function get_bdev_path() that translates device number $1 into a
@@ -223,3 +223,27 @@ _test_dev_is_zoned() {
fi
return 0
}
+
+# Set scheduler of block device $1 to $2.
+set_scheduler() {
+ local b=$1 p s=$2
+
+ p=/sys/class/block/$b/queue/scheduler
+ if [ -e "/sys/block/$b/mq" ]; then
+ case "$s" in
+ noop) s=none;;
+ deadline) s=mq-deadline;;
+ bfq) s=bfq;;
+ esac
+ else
+ case "$s" in
+ none) s=noop;;
+ mq-deadline) s=deadline;;
+ bfq-mq) s=bfq;;
+ esac
+ fi
+ if ! echo "$s" > "$p"; then
+ echo "Changing scheduler of $b from $(<"$p") into $s failed"
+ return 1
+ fi
+}