summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDan Horák <dan@danny.cz>2011-02-01 14:12:19 +0100
committerDan Horák <dan@danny.cz>2011-02-01 14:12:19 +0100
commit95b3d22735edc950c2bf741513b4700502990037 (patch)
tree2120364caa3aef61bf6cdaec3b74639caf810c6e
parentcd21d27a438a086bb86c1b06890b18398de1a654 (diff)
downloadutils-95b3d22735edc950c2bf741513b4700502990037.tar.gz
utils-95b3d22735edc950c2bf741513b4700502990037.tar.xz
utils-95b3d22735edc950c2bf741513b4700502990037.zip
use the /proc/cio_settle interface to wait until devices become online
The /proc/cio_settle interface (if available) is used to wait until devices become online. It should seedup the whole process of unblocking devices and also solves situations when non-existent devices are unblocked and timeout is reached when waiting for every such device.
-rw-r--r--device_cio_free8
1 files changed, 7 insertions, 1 deletions
diff --git a/device_cio_free b/device_cio_free
index 416224b..3367ba1 100644
--- a/device_cio_free
+++ b/device_cio_free
@@ -26,6 +26,7 @@ DASDCONFIG=/etc/dasd.conf
ZFCPCONFIG=/etc/zfcp.conf
ZNETCONFIG=/etc/ccw.conf
BLACKLIST=/proc/cio_ignore
+CIO_SETTLE=/proc/cio_settle
VERBOSE=
PATH=/bin:/sbin
DEVICE= # list of devices given on command line
@@ -302,4 +303,9 @@ fi
[ -z "$ALL_DEVICES" ] && exit 0
-wait_on_devices
+if [ -w $CIO_SETTLE ]; then
+ [ $VERBOSE ] && echo "Waiting until all pending CIO requests are processed"
+ echo 1 > $CIO_SETTLE
+else
+ wait_on_devices
+fi