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.
This commit is contained in:
mrg 2011-04-23 22:22:46 +00:00
parent 6a7d2e04ad
commit d9a6814d47
2 changed files with 13 additions and 11 deletions

View File

@ -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 @@ rf_Shutdown(RF_Raid_t *raidPtr)
"rfreshutdown",0);
}
mutex_destroy(&raidPtr->iodone_lock);
cv_destroy(&raidPtr->iodone_cv);
raidPtr->valid = 0;
if (raidPtr->parity_map != NULL)
@ -353,10 +350,6 @@ rf_Configure(RF_Raid_t *raidPtr, RF_Config_t *cfgPtr, RF_AutoConfig_t *ac)
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);

View File

@ -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 @@ rf_ShutdownEngine(void *arg)
DO_SIGNAL(raidPtr);
DO_UNLOCK(raidPtr);
mutex_destroy(&raidPtr->iodone_lock);
cv_destroy(&raidPtr->iodone_cv);
}
int
@ -127,6 +129,13 @@ rf_ConfigureEngine(RF_ShutdownList_t **listp, RF_Raid_t *raidPtr,
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;