summaryrefslogtreecommitdiff
path: root/sys/dev/raidframe
diff options
context:
space:
mode:
authoroster <oster@NetBSD.org>2003-12-29 06:19:28 +0000
committeroster <oster@NetBSD.org>2003-12-29 06:19:28 +0000
commite276d553e6e9d96ce188c2b32301799422b20c98 (patch)
treeca3d88ce070945db1912e5d3a5983dba41cd93ce /sys/dev/raidframe
parent8b09b35f45308f66c139211500cda97668f76778 (diff)
Garbage-collect a whole mess of this RF_THREADGROUP_* stuff that isn't
being used. Then, nuke rf_init_managed_threadgroup() and all descendants and relations.
Diffstat (limited to 'sys/dev/raidframe')
-rw-r--r--sys/dev/raidframe/rf_engine.c21
-rw-r--r--sys/dev/raidframe/rf_raid.h3
-rw-r--r--sys/dev/raidframe/rf_threadstuff.c22
-rw-r--r--sys/dev/raidframe/rf_threadstuff.h83
4 files changed, 7 insertions, 122 deletions
diff --git a/sys/dev/raidframe/rf_engine.c b/sys/dev/raidframe/rf_engine.c
index e30fd9d8fd4..27d5f10d581 100644
--- a/sys/dev/raidframe/rf_engine.c
+++ b/sys/dev/raidframe/rf_engine.c
@@ -1,4 +1,4 @@
-/* $NetBSD: rf_engine.c,v 1.27 2003/12/29 05:48:13 oster Exp $ */
+/* $NetBSD: rf_engine.c,v 1.28 2003/12/29 06:19:28 oster 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.27 2003/12/29 05:48:13 oster Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rf_engine.c,v 1.28 2003/12/29 06:19:28 oster Exp $");
#include <sys/errno.h>
@@ -135,10 +135,6 @@ rf_ConfigureEngine(
raidPtr->node_queue = NULL;
raidPtr->dags_in_flight = 0;
- rc = rf_init_managed_threadgroup(listp, &raidPtr->engine_tg);
- if (rc)
- return (rc);
-
/* we create the execution thread only once per system boot. no need
* to check return code b/c the kernel panics if it can't create the
* thread. */
@@ -162,14 +158,7 @@ rf_ConfigureEngine(
if (rf_engineDebug) {
printf("raid%d: Created engine thread\n", raidPtr->raidid);
}
- RF_THREADGROUP_STARTED(&raidPtr->engine_tg);
- /* XXX something is missing here... */
-#ifdef debug
- printf("Skipping the WAIT_START!!\n");
-#endif
-#if 0
- RF_THREADGROUP_WAIT_START(&raidPtr->engine_tg);
-#endif
+
/* engine thread is now running and waiting for work */
if (rf_engineDebug) {
printf("raid%d: Engine thread running and waiting for events\n", raidPtr->raidid);
@@ -760,8 +749,6 @@ DAGExecutionThread(RF_ThreadArg_t arg)
s = splbio();
- RF_THREADGROUP_RUNNING(&raidPtr->engine_tg);
-
DO_LOCK(raidPtr);
while (!raidPtr->shutdown_engine) {
@@ -832,8 +819,6 @@ DAGExecutionThread(RF_ThreadArg_t arg)
}
DO_UNLOCK(raidPtr);
- RF_THREADGROUP_DONE(&raidPtr->engine_tg);
-
splx(s);
kthread_exit(0);
}
diff --git a/sys/dev/raidframe/rf_raid.h b/sys/dev/raidframe/rf_raid.h
index 951126660bf..96c89856924 100644
--- a/sys/dev/raidframe/rf_raid.h
+++ b/sys/dev/raidframe/rf_raid.h
@@ -1,4 +1,4 @@
-/* $NetBSD: rf_raid.h,v 1.20 2003/12/29 05:58:34 oster Exp $ */
+/* $NetBSD: rf_raid.h,v 1.21 2003/12/29 06:19:28 oster Exp $ */
/*
* Copyright (c) 1995 Carnegie-Mellon University.
* All rights reserved.
@@ -220,7 +220,6 @@ struct RF_Raid_s {
RF_Thread_t engine_thread;
RF_Thread_t engine_helper_thread;
RF_Thread_t recon_thread;
- RF_ThreadGroup_t engine_tg;
int shutdown_engine;
int shutdown_raidio;
int dags_in_flight; /* debug */
diff --git a/sys/dev/raidframe/rf_threadstuff.c b/sys/dev/raidframe/rf_threadstuff.c
index 55f52b27371..e4966f5cc0c 100644
--- a/sys/dev/raidframe/rf_threadstuff.c
+++ b/sys/dev/raidframe/rf_threadstuff.c
@@ -1,4 +1,4 @@
-/* $NetBSD: rf_threadstuff.c,v 1.18 2003/12/29 05:48:13 oster Exp $ */
+/* $NetBSD: rf_threadstuff.c,v 1.19 2003/12/29 06:19:28 oster Exp $ */
/*
* rf_threadstuff.c
*/
@@ -30,7 +30,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: rf_threadstuff.c,v 1.18 2003/12/29 05:48:13 oster Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rf_threadstuff.c,v 1.19 2003/12/29 06:19:28 oster Exp $");
#include <dev/raidframe/raidframevar.h>
@@ -39,24 +39,6 @@ __KERNEL_RCSID(0, "$NetBSD: rf_threadstuff.c,v 1.18 2003/12/29 05:48:13 oster Ex
#include "rf_shutdown.h"
/*
- * Shared stuff
- */
-
-int
-_rf_init_managed_threadgroup(listp, g, file, line)
- RF_ShutdownList_t **listp;
- RF_ThreadGroup_t *g;
- char *file;
- int line;
-{
-
- rf_mutex_init(&g->mutex);
- g->cond = 0;
- g->created = g->running = g->shutdown = 0;
- return (0);
-}
-
-/*
* Kernel
*/
int
diff --git a/sys/dev/raidframe/rf_threadstuff.h b/sys/dev/raidframe/rf_threadstuff.h
index d9a944dac8c..cc7a2aa4c15 100644
--- a/sys/dev/raidframe/rf_threadstuff.h
+++ b/sys/dev/raidframe/rf_threadstuff.h
@@ -1,4 +1,4 @@
-/* $NetBSD: rf_threadstuff.h,v 1.18 2003/12/29 05:48:13 oster Exp $ */
+/* $NetBSD: rf_threadstuff.h,v 1.19 2003/12/29 06:19:28 oster Exp $ */
/*
* Copyright (c) 1995 Carnegie-Mellon University.
* All rights reserved.
@@ -51,16 +51,6 @@
#include <dev/raidframe/raidframevar.h>
-#define rf_init_managed_threadgroup(a,b) _rf_init_managed_threadgroup(a,b,__FILE__,__LINE__)
-#define rf_init_threadgroup(a) _rf_init_threadgroup(a,__FILE__,__LINE__)
-#define rf_destroy_threadgroup(a) _rf_destroy_threadgroup(a,__FILE__,__LINE__)
-
-int _rf_init_threadgroup(RF_ThreadGroup_t * g, char *file, int line);
-int _rf_destroy_threadgroup(RF_ThreadGroup_t * g, char *file, int line);
-int
-_rf_init_managed_threadgroup(RF_ShutdownList_t ** listp,
- RF_ThreadGroup_t * g, char *file, int line);
-
#include <sys/lock.h>
#define decl_simple_lock_data(a,b) a struct simplelock b;
@@ -108,77 +98,6 @@ typedef void *RF_ThreadArg_t;
kthread_create1((void (*)(void *))(_func_), (void *)(_arg_), \
(struct proc **)&(_handle_), _fmt_, _fmt_arg_)
-struct RF_ThreadGroup_s {
- int created;
- int running;
- int shutdown;
- RF_DECLARE_MUTEX(mutex)
- RF_DECLARE_COND(cond)
-};
-/*
- * Someone has started a thread in the group
- */
-#define RF_THREADGROUP_STARTED(_g_) { \
- RF_LOCK_MUTEX((_g_)->mutex); \
- (_g_)->created++; \
- RF_UNLOCK_MUTEX((_g_)->mutex); \
-}
-
-/*
- * Thread announcing that it is now running
- */
-#define RF_THREADGROUP_RUNNING(_g_) { \
- RF_LOCK_MUTEX((_g_)->mutex); \
- (_g_)->running++; \
- RF_UNLOCK_MUTEX((_g_)->mutex); \
- RF_SIGNAL_COND((_g_)->cond); \
-}
-
-/*
- * Thread announcing that it is now done
- */
-#define RF_THREADGROUP_DONE(_g_) { \
- RF_LOCK_MUTEX((_g_)->mutex); \
- (_g_)->shutdown++; \
- RF_UNLOCK_MUTEX((_g_)->mutex); \
- RF_SIGNAL_COND((_g_)->cond); \
-}
-
-/*
- * Wait for all threads to start running
- */
-#define RF_THREADGROUP_WAIT_START(_g_) { \
- RF_LOCK_MUTEX((_g_)->mutex); \
- while((_g_)->running < (_g_)->created) { \
- RF_WAIT_COND((_g_)->cond, (_g_)->mutex); \
- } \
- RF_UNLOCK_MUTEX((_g_)->mutex); \
-}
-
-/*
- * Wait for all threads to stop running
- */
-#ifndef __NetBSD__
-#define RF_THREADGROUP_WAIT_STOP(_g_) { \
- RF_LOCK_MUTEX((_g_)->mutex); \
- RF_ASSERT((_g_)->running == (_g_)->created); \
- while((_g_)->shutdown < (_g_)->running) { \
- RF_WAIT_COND((_g_)->cond, (_g_)->mutex); \
- } \
- RF_UNLOCK_MUTEX((_g_)->mutex); \
-}
-#else
- /* XXX Note that we've removed the assert. That should get put back in once
- * we actually get something like a kernel thread running */
-#define RF_THREADGROUP_WAIT_STOP(_g_) { \
- RF_LOCK_MUTEX((_g_)->mutex); \
- while((_g_)->shutdown < (_g_)->running) { \
- RF_WAIT_COND((_g_)->cond, (_g_)->mutex); \
- } \
- RF_UNLOCK_MUTEX((_g_)->mutex); \
-}
-#endif
-
#define rf_mutex_init(m) simple_lock_init(m)
int rf_lkmgr_mutex_init(struct lock *);