Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/dev/raidframe move the iodone setup and tear down into r...



details:   https://anonhg.NetBSD.org/src/rev/2385d98200d7
branches:  trunk
changeset: 764449:2385d98200d7
user:      mrg <mrg%NetBSD.org@localhost>
date:      Sat Apr 23 22:22:46 2011 +0000

description:
move the iodone setup and tear down into rf_engine.c.  this fixes
"raidctl -u" and should also help the case where we fail to setup
a device part of the way through.

diffstat:

 sys/dev/raidframe/rf_driver.c |  11 ++---------
 sys/dev/raidframe/rf_engine.c |  13 +++++++++++--
 2 files changed, 13 insertions(+), 11 deletions(-)

diffs (80 lines):

diff -r e7437de86593 -r 2385d98200d7 sys/dev/raidframe/rf_driver.c
--- a/sys/dev/raidframe/rf_driver.c     Sat Apr 23 18:57:27 2011 +0000
+++ b/sys/dev/raidframe/rf_driver.c     Sat Apr 23 22:22:46 2011 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: rf_driver.c,v 1.123 2011/04/23 06:29:05 mrg Exp $      */
+/*     $NetBSD: rf_driver.c,v 1.124 2011/04/23 22:22:46 mrg Exp $      */
 /*-
  * Copyright (c) 1999 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -66,7 +66,7 @@
 
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: rf_driver.c,v 1.123 2011/04/23 06:29:05 mrg Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rf_driver.c,v 1.124 2011/04/23 22:22:46 mrg Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_raid_diagnostic.h"
@@ -240,9 +240,6 @@
                       "rfreshutdown",0);
        }
 
-       mutex_destroy(&raidPtr->iodone_lock);
-       cv_destroy(&raidPtr->iodone_cv);
-
        raidPtr->valid = 0;
 
        if (raidPtr->parity_map != NULL)
@@ -353,10 +350,6 @@
        raidPtr->status = rf_rs_optimal;
        raidPtr->reconControl = NULL;
 
-       TAILQ_INIT(&(raidPtr->iodone));
-       mutex_init(&raidPtr->iodone_lock, MUTEX_DEFAULT, IPL_VM);
-       cv_init(&raidPtr->iodone_cv, "raidiow");
-
        DO_RAID_INIT_CONFIGURE(rf_ConfigureEngine);
        DO_RAID_INIT_CONFIGURE(rf_ConfigureStripeLocks);
 
diff -r e7437de86593 -r 2385d98200d7 sys/dev/raidframe/rf_engine.c
--- a/sys/dev/raidframe/rf_engine.c     Sat Apr 23 18:57:27 2011 +0000
+++ b/sys/dev/raidframe/rf_engine.c     Sat Apr 23 22:22:46 2011 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: rf_engine.c,v 1.42 2011/04/23 06:29:05 mrg Exp $       */
+/*     $NetBSD: rf_engine.c,v 1.43 2011/04/23 22:22:46 mrg Exp $       */
 /*
  * Copyright (c) 1995 Carnegie-Mellon University.
  * All rights reserved.
@@ -55,7 +55,7 @@
  ****************************************************************************/
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: rf_engine.c,v 1.42 2011/04/23 06:29:05 mrg Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rf_engine.c,v 1.43 2011/04/23 22:22:46 mrg Exp $");
 
 #include <sys/errno.h>
 
@@ -120,6 +120,8 @@
        DO_SIGNAL(raidPtr);
        DO_UNLOCK(raidPtr);
 
+       mutex_destroy(&raidPtr->iodone_lock);
+       cv_destroy(&raidPtr->iodone_cv);
 }
 
 int
@@ -127,6 +129,13 @@
                   RF_Config_t *cfgPtr)
 {
 
+       /*
+        * Initialise iodone for the IO thread.
+        */
+       TAILQ_INIT(&(raidPtr->iodone));
+       mutex_init(&raidPtr->iodone_lock, MUTEX_DEFAULT, IPL_VM);
+       cv_init(&raidPtr->iodone_cv, "raidiow");
+
        rf_mutex_init(&raidPtr->node_queue_mutex);
        raidPtr->node_queue = NULL;
        raidPtr->dags_in_flight = 0;



Home | Main Index | Thread Index | Old Index