summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorgrog <grog@FreeBSD.org>1999-06-24 08:57:16 +0000
committergrog <grog@FreeBSD.org>1999-06-24 08:57:16 +0000
commit314bcdc31b2344a991a53606287991fe96c934b9 (patch)
treecdc3dd0115f24578787bce11016591ceddd702d8
parent7dbbfe09e70baf696bab8f8805a813d8861fb502 (diff)
downloadFreeBSD-src-314bcdc31b2344a991a53606287991fe96c934b9.zip
FreeBSD-src-314bcdc31b2344a991a53606287991fe96c934b9.tar.gz
set_drive_state:
If the drive goes down, queue a close to the daemon. In many cases this function gets called in process context, so it could do it directly, but it's more trouble finding out where we came from than getting the daemon to do it.
-rw-r--r--sys/dev/vinum/vinumstate.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/sys/dev/vinum/vinumstate.c b/sys/dev/vinum/vinumstate.c
index 2e9cc08..850caa8 100644
--- a/sys/dev/vinum/vinumstate.c
+++ b/sys/dev/vinum/vinumstate.c
@@ -65,6 +65,9 @@ set_drive_state(int driveno, enum drivestate newstate, enum setstateflags flags)
if ((drive->state == drive_up)
&& (drive->vp == NULL)) /* should be open, but we're not */
init_drive(drive, 1); /* which changes the state again */
+ if (newstate < drive_up) /* drive going down, */
+ queue_daemon_request(daemonrq_closedrive, /* get the daemon to close it */
+ (union daemoninfo) drive);
if (newstate != oldstate) { /* state has changed */
for (sdno = 0; sdno < vinum_conf.subdisks_allocated; sdno++) { /* find this drive's subdisks */
if ((SD[sdno].state >= sd_referenced)
OpenPOWER on IntegriCloud