Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/dev/raidframe - nuke calls to rf_get_threadid() and asso...
details: https://anonhg.NetBSD.org/src/rev/d498876648ca
branches: trunk
changeset: 480286:d498876648ca
user: oster <oster%NetBSD.org@localhost>
date: Sat Jan 08 22:57:30 2000 +0000
description:
- nuke calls to rf_get_threadid() and associated #include
- change a bunch of debugging printfs from
"[%d] ...", tid (where tid is the "thread id")
to
"raid%d: ...", raidPtr->raidid
- other minor rototillage
diffstat:
sys/dev/raidframe/rf_driver.c | 20 +++--------
sys/dev/raidframe/rf_engine.c | 48 ++++++++++-----------------
sys/dev/raidframe/rf_paritylogging.c | 41 ++++++++---------------
sys/dev/raidframe/rf_psstatus.c | 8 +--
sys/dev/raidframe/rf_raid1.c | 61 ++++++++++++++++++-----------------
sys/dev/raidframe/rf_raid5.c | 13 +++----
sys/dev/raidframe/rf_reconstruct.c | 30 ++++++++--------
sys/dev/raidframe/rf_shutdown.c | 11 +----
sys/dev/raidframe/rf_states.c | 14 +++----
9 files changed, 103 insertions(+), 143 deletions(-)
diffs (truncated from 819 to 300 lines):
diff -r 7d2bcb98e6b1 -r d498876648ca sys/dev/raidframe/rf_driver.c
--- a/sys/dev/raidframe/rf_driver.c Sat Jan 08 21:07:02 2000 +0000
+++ b/sys/dev/raidframe/rf_driver.c Sat Jan 08 22:57:30 2000 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: rf_driver.c,v 1.21 2000/01/07 03:25:34 oster Exp $ */
+/* $NetBSD: rf_driver.c,v 1.22 2000/01/08 22:57:31 oster Exp $ */
/*-
* Copyright (c) 1999 The NetBSD Foundation, Inc.
* All rights reserved.
@@ -91,7 +91,6 @@
#include "rf_diskqueue.h"
#include "rf_parityscan.h"
#include "rf_alloclist.h"
-#include "rf_threadid.h"
#include "rf_dagutils.h"
#include "rf_utils.h"
#include "rf_etimer.h"
@@ -643,7 +642,7 @@
desc->numPending = 0;
desc->cleanupList = NULL;
rf_MakeAllocList(desc->cleanupList);
- rf_get_threadid(desc->tid);
+ desc->tid = 0; /* XXX Make this go away */
return (desc);
}
@@ -689,7 +688,6 @@
bp_in is a buf pointer. void * to facilitate ignoring it outside the kernel
*/
{
- int tid;
RF_RaidAccessDesc_t *desc;
caddr_t lbufPtr = bufPtr;
struct buf *bp = (struct buf *) bp_in;
@@ -702,13 +700,12 @@
return (EINVAL);
}
- rf_get_threadid(tid);
if (rf_accessDebug) {
printf("logBytes is: %d %d %d\n", raidPtr->raidid,
raidPtr->logBytesPerSector,
(int) rf_RaidAddressToByte(raidPtr, numBlocks));
- printf("[%d] %s raidAddr %d (stripeid %d-%d) numBlocks %d (%d bytes) buf 0x%lx\n", tid,
+ printf("raid%d: %s raidAddr %d (stripeid %d-%d) numBlocks %d (%d bytes) buf 0x%lx\n", raidPtr->raidid,
(type == RF_IO_TYPE_READ) ? "READ" : "WRITE", (int) raidAddress,
(int) rf_RaidAddressToStripeID(&raidPtr->Layout, raidAddress),
(int) rf_RaidAddressToStripeID(&raidPtr->Layout, raidAddress + numBlocks - 1),
@@ -772,10 +769,7 @@
int fcol,
int initRecon)
{
- int tid;
-
- rf_get_threadid(tid);
- printf("[%d] Failing disk r%d c%d\n", tid, frow, fcol);
+ printf("raid%d: Failing disk r%d c%d\n", raidPtr->raidid, frow, fcol);
RF_LOCK_MUTEX(raidPtr->mutex);
raidPtr->numFailures++;
raidPtr->Disks[frow][fcol].status = rf_ds_failed;
@@ -793,11 +787,9 @@
RF_Raid_t *raidPtr;
RF_RaidReconDesc_t *reconDesc;
{
- int tid;
-
if (rf_quiesceDebug) {
- rf_get_threadid(tid);
- printf("[%d] Signalling quiescence lock\n", tid);
+ printf("raid%d: Signalling quiescence lock\n",
+ raidPtr->raidid);
}
raidPtr->access_suspend_release = 1;
diff -r 7d2bcb98e6b1 -r d498876648ca sys/dev/raidframe/rf_engine.c
--- a/sys/dev/raidframe/rf_engine.c Sat Jan 08 21:07:02 2000 +0000
+++ b/sys/dev/raidframe/rf_engine.c Sat Jan 08 22:57:30 2000 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: rf_engine.c,v 1.8 2000/01/08 03:34:31 oster Exp $ */
+/* $NetBSD: rf_engine.c,v 1.9 2000/01/08 22:57:31 oster Exp $ */
/*
* Copyright (c) 1995 Carnegie-Mellon University.
* All rights reserved.
@@ -60,7 +60,6 @@
#include "rf_dag.h"
#include "rf_engine.h"
-#include "rf_threadid.h"
#include "rf_etimer.h"
#include "rf_general.h"
#include "rf_dagutils.h"
@@ -110,11 +109,8 @@
RF_Raid_t * raidPtr,
RF_Config_t * cfgPtr)
{
- int rc, tid = 0;
+ int rc;
- if (rf_engineDebug) {
- rf_get_threadid(tid);
- }
DO_INIT(listp, raidPtr);
raidPtr->node_queue = NULL;
@@ -128,14 +124,14 @@
* to check return code b/c the kernel panics if it can't create the
* thread. */
if (rf_engineDebug) {
- printf("[%d] Creating engine thread\n", tid);
+ printf("raid%d: Creating engine thread\n", raidPtr->raidid);
}
if (RF_CREATE_THREAD(raidPtr->engine_thread, DAGExecutionThread, raidPtr,"raid")) {
RF_ERRORMSG("RAIDFRAME: Unable to create engine thread\n");
return (ENOMEM);
}
if (rf_engineDebug) {
- printf("[%d] Created engine thread\n", tid);
+ printf("raid%d: Created engine thread\n", raidPtr->raidid);
}
RF_THREADGROUP_STARTED(&raidPtr->engine_tg);
/* XXX something is missing here... */
@@ -147,7 +143,7 @@
#endif
/* engine thread is now running and waiting for work */
if (rf_engineDebug) {
- printf("[%d] Engine thread running and waiting for events\n", tid);
+ printf("raid%d: Engine thread running and waiting for events\n", raidPtr->raidid);
}
rc = rf_ShutdownCreate(listp, rf_ShutdownEngine, raidPtr);
if (rc) {
@@ -243,14 +239,13 @@
static void
FireNode(RF_DagNode_t * node)
{
- int tid;
-
switch (node->status) {
case rf_fired:
/* fire the do function of a node */
if (rf_engineDebug) {
- rf_get_threadid(tid);
- printf("[%d] Firing node 0x%lx (%s)\n", tid, (unsigned long) node, node->name);
+ printf("raid%d: Firing node 0x%lx (%s)\n",
+ node->dagHdr->raidPtr->raidid,
+ (unsigned long) node, node->name);
}
if (node->flags & RF_DAGNODE_FLAG_YIELD) {
#if defined(__NetBSD__) && defined(_KERNEL)
@@ -266,9 +261,10 @@
break;
case rf_recover:
/* fire the undo function of a node */
- if (rf_engineDebug || 1) {
- rf_get_threadid(tid);
- printf("[%d] Firing (undo) node 0x%lx (%s)\n", tid, (unsigned long) node, node->name);
+ if (rf_engineDebug) {
+ printf("raid%d: Firing (undo) node 0x%lx (%s)\n",
+ node->dagHdr->raidPtr->raidid,
+ (unsigned long) node, node->name);
}
if (node->flags & RF_DAGNODE_FLAG_YIELD)
#if defined(__NetBSD__) && defined(_KERNEL)
@@ -397,7 +393,7 @@
{
RF_DagNode_t *s, *a;
RF_Raid_t *raidPtr;
- int tid, i, ks;
+ int i, ks;
RF_DagNode_t *finishlist = NULL; /* a list of NIL nodes to be
* finished */
RF_DagNode_t *skiplist = NULL; /* list of nodes with failed truedata
@@ -406,8 +402,6 @@
RF_DagNode_t *q = NULL, *qh = NULL, *next;
int j, skipNode;
- rf_get_threadid(tid);
-
raidPtr = node->dagHdr->raidPtr;
DO_LOCK(raidPtr);
@@ -597,7 +591,6 @@
int context)
{
RF_Raid_t *raidPtr;
- int tid;
raidPtr = node->dagHdr->raidPtr;
@@ -610,15 +603,13 @@
node->dagHdr->status = rf_rollForward; /* crossed commit
* barrier */
if (rf_engineDebug || 1) {
- rf_get_threadid(tid);
- printf("[%d] node (%s) returned fail, rolling forward\n", tid, node->name);
+ printf("raid%d: node (%s) returned fail, rolling forward\n", raidPtr->raidid, node->name);
}
} else {
node->dagHdr->status = rf_rollBackward; /* never reached commit
* barrier */
if (rf_engineDebug || 1) {
- rf_get_threadid(tid);
- printf("[%d] node (%s) returned fail, rolling backward\n", tid, node->name);
+ printf("raid%d: node (%s) returned fail, rolling backward\n", raidPtr->raidid, node->name);
}
}
break;
@@ -680,7 +671,6 @@
void *cbArg)
{
RF_Raid_t *raidPtr;
- int tid;
raidPtr = dag->raidPtr;
if (dag->tracerec) {
@@ -691,8 +681,7 @@
RF_PANIC();
}
if (rf_engineDebug) {
- rf_get_threadid(tid);
- printf("[%d] Entering DispatchDAG\n", tid);
+ printf("raid%d: Entering DispatchDAG\n", raidPtr->raidid);
}
raidPtr->dags_in_flight++; /* debug only: blow off proper
* locking */
@@ -719,14 +708,13 @@
{
RF_DagNode_t *nd, *local_nq, *term_nq, *fire_nq;
RF_Raid_t *raidPtr;
- int ks, tid;
+ int ks;
int s;
raidPtr = (RF_Raid_t *) arg;
if (rf_engineDebug) {
- rf_get_threadid(tid);
- printf("[%d] Engine thread is running\n", tid);
+ printf("raid%d: Engine thread is running\n", raidPtr->raidid);
}
s = splbio();
diff -r 7d2bcb98e6b1 -r d498876648ca sys/dev/raidframe/rf_paritylogging.c
--- a/sys/dev/raidframe/rf_paritylogging.c Sat Jan 08 21:07:02 2000 +0000
+++ b/sys/dev/raidframe/rf_paritylogging.c Sat Jan 08 22:57:30 2000 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: rf_paritylogging.c,v 1.5 2000/01/08 05:13:26 oster Exp $ */
+/* $NetBSD: rf_paritylogging.c,v 1.6 2000/01/08 22:57:31 oster Exp $ */
/*
* Copyright (c) 1995 Carnegie-Mellon University.
* All rights reserved.
@@ -44,7 +44,6 @@
#include "rf_dagffwr.h"
#include "rf_dagdegrd.h"
#include "rf_dagdegwr.h"
-#include "rf_threadid.h"
#include "rf_paritylog.h"
#include "rf_paritylogDiskMgr.h"
#include "rf_paritylogging.h"
@@ -540,9 +539,8 @@
raidPtr = (RF_Raid_t *) arg;
if (rf_parityLogDebug) {
- int tid;
- rf_get_threadid(tid);
- printf("[%d] ShutdownParityLoggingRegionInfo\n", tid);
+ printf("raid%d: ShutdownParityLoggingRegionInfo\n",
+ raidPtr->raidid);
}
/* free region information structs */
for (i = 0; i < rf_numParityRegions; i++)
@@ -558,9 +556,7 @@
raidPtr = (RF_Raid_t *) arg;
if (rf_parityLogDebug) {
- int tid;
- rf_get_threadid(tid);
- printf("[%d] ShutdownParityLoggingPool\n", tid);
+ printf("raid%d: ShutdownParityLoggingPool\n", raidPtr->raidid);
}
/* free contents of parityLogPool */
FreeParityLogQueue(raidPtr, &raidPtr->parityLogPool);
@@ -574,9 +570,8 @@
raidPtr = (RF_Raid_t *) arg;
if (rf_parityLogDebug) {
- int tid;
- rf_get_threadid(tid);
- printf("[%d] ShutdownParityLoggingRegionBufferPool\n", tid);
+ printf("raid%d: ShutdownParityLoggingRegionBufferPool\n",
+ raidPtr->raidid);
}
FreeRegionBufferQueue(&raidPtr->regionBufferPool);
}
@@ -588,9 +583,8 @@
raidPtr = (RF_Raid_t *) arg;
if (rf_parityLogDebug) {
- int tid;
- rf_get_threadid(tid);
Home |
Main Index |
Thread Index |
Old Index