From 314bcdc31b2344a991a53606287991fe96c934b9 Mon Sep 17 00:00:00 2001 From: grog Date: Thu, 24 Jun 1999 08:57:16 +0000 Subject: 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. --- sys/dev/vinum/vinumstate.c | 3 +++ 1 file changed, 3 insertions(+) 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) -- cgit v1.1