Module Name:    src
Committed By:   mrg
Date:           Sat Apr 23 22:22:46 UTC 2011

Modified Files:
        src/sys/dev/raidframe: rf_driver.c rf_engine.c

Log Message:
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.


To generate a diff of this commit:
cvs rdiff -u -r1.123 -r1.124 src/sys/dev/raidframe/rf_driver.c
cvs rdiff -u -r1.42 -r1.43 src/sys/dev/raidframe/rf_engine.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/raidframe/rf_driver.c
diff -u src/sys/dev/raidframe/rf_driver.c:1.123 src/sys/dev/raidframe/rf_driver.c:1.124
--- src/sys/dev/raidframe/rf_driver.c:1.123	Sat Apr 23 06:29:05 2011
+++ src/sys/dev/raidframe/rf_driver.c	Sat Apr 23 22:22:46 2011
@@ -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);
 

Index: src/sys/dev/raidframe/rf_engine.c
diff -u src/sys/dev/raidframe/rf_engine.c:1.42 src/sys/dev/raidframe/rf_engine.c:1.43
--- src/sys/dev/raidframe/rf_engine.c:1.42	Sat Apr 23 06:29:05 2011
+++ src/sys/dev/raidframe/rf_engine.c	Sat Apr 23 22:22:46 2011
@@ -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;

Reply via email to