]> www.infradead.org Git - users/hch/blktests.git/commitdiff
block/024: convert to use _configure_null_blk
authorChristoph Hellwig <hch@lst.de>
Tue, 7 Jun 2022 12:47:38 +0000 (14:47 +0200)
committerShin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com>
Wed, 8 Jun 2022 04:31:31 +0000 (13:31 +0900)
Switch to use _configure_null_blk so that built-in null_blk can be
supported, which implies not using the default nullb0 device.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Shin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com>
tests/block/024

index 6808db0ab989b5f88b623107f6abdb1130eba58c..2a7c934a42ca823137612cfcc85fa91830213b83 100755 (executable)
@@ -17,13 +17,13 @@ requires() {
 }
 
 init_times() {
-       init_read_ms="$(awk '{ print $4 }' /sys/block/nullb0/stat)"
-       init_write_ms="$(awk '{ print $8 }' /sys/block/nullb0/stat)"
+       init_read_ms="$(awk '{ print $4 }' /sys/block/nullb1/stat)"
+       init_write_ms="$(awk '{ print $8 }' /sys/block/nullb1/stat)"
 }
 
 show_times() {
-       read_ms="$(awk '{ print $4 }' /sys/block/nullb0/stat)"
-       write_ms="$(awk '{ print $8 }' /sys/block/nullb0/stat)"
+       read_ms="$(awk '{ print $4 }' /sys/block/nullb1/stat)"
+       write_ms="$(awk '{ print $8 }' /sys/block/nullb1/stat)"
 
        # Print rounded to the nearest second
        printf 'read %d s\n' $(((read_ms - init_read_ms + 500) / 1000))
@@ -37,7 +37,8 @@ test() {
 
        # The maximum value for CONFIG_HZ is 1000. I.e., a tick is one
        # millisecond. So, make each I/O take half a millisecond.
-       if ! _init_null_blk irqmode=2 completion_nsec=500000; then
+       if ! _configure_null_blk nullb1 irqmode=2 completion_nsec=500000 \
+                       power=1; then
                return 1
        fi
 
@@ -46,16 +47,16 @@ test() {
 
        # 1500 * 0.5 ms is 0.75 seconds, allowing for some overhead so
        # that it rounds to one second.
-       dd if=/dev/nullb0 of=/dev/null bs=4096 iflag=direct count=1500 status=none
+       dd if=/dev/nullb1 of=/dev/null bs=4096 iflag=direct count=1500 status=none
        show_times
 
-       dd if=/dev/zero of=/dev/nullb0 bs=4096 oflag=direct count=1500 status=none
+       dd if=/dev/zero of=/dev/nullb1 bs=4096 oflag=direct count=1500 status=none
        show_times
 
        # 1800 * 0.5 ms is 0.9 seconds.
-       dd if=/dev/nullb0 of=/dev/null bs=4096 iflag=direct count=1500 status=none &
-       dd if=/dev/zero of=/dev/nullb0 bs=4096 oflag=direct count=1800 status=none &
-       dd if=/dev/zero of=/dev/nullb0 bs=4096 oflag=direct count=1800 status=none &
+       dd if=/dev/nullb1 of=/dev/null bs=4096 iflag=direct count=1500 status=none &
+       dd if=/dev/zero of=/dev/nullb1 bs=4096 oflag=direct count=1800 status=none &
+       dd if=/dev/zero of=/dev/nullb1 bs=4096 oflag=direct count=1800 status=none &
        wait
        show_times