summaryrefslogtreecommitdiff
path: root/sys/dev/raidframe/rf_raid1.c
diff options
context:
space:
mode:
authoroster <oster@NetBSD.org>2000-01-08 22:57:30 +0000
committeroster <oster@NetBSD.org>2000-01-08 22:57:30 +0000
commit04719e3adccf878a35539e9db8ce9f0bcddade77 (patch)
tree7d9bc8634dec53bfc955213dc308a6e986caf804 /sys/dev/raidframe/rf_raid1.c
parentce3b031d6ded503f0c0964b747068f4c3e604ff2 (diff)
- 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 (limited to 'sys/dev/raidframe/rf_raid1.c')
-rw-r--r--sys/dev/raidframe/rf_raid1.c61
1 files changed, 32 insertions, 29 deletions
diff --git a/sys/dev/raidframe/rf_raid1.c b/sys/dev/raidframe/rf_raid1.c
index c0599f1b631..c85e92dd25d 100644
--- a/sys/dev/raidframe/rf_raid1.c
+++ b/sys/dev/raidframe/rf_raid1.c
@@ -1,4 +1,4 @@
-/* $NetBSD: rf_raid1.c,v 1.4 1999/08/13 03:41:57 oster Exp $ */
+/* $NetBSD: rf_raid1.c,v 1.5 2000/01/08 22:57:30 oster Exp $ */
/*
* Copyright (c) 1995 Carnegie-Mellon University.
* All rights reserved.
@@ -40,7 +40,6 @@
#include "rf_dagdegrd.h"
#include "rf_dagutils.h"
#include "rf_dagfuncs.h"
-#include "rf_threadid.h"
#include "rf_diskqueue.h"
#include "rf_general.h"
#include "rf_utils.h"
@@ -195,7 +194,7 @@ rf_RAID1DagSelect(
{
RF_RowCol_t frow, fcol, or, oc;
RF_PhysDiskAddr_t *failedPDA;
- int prior_recon, tid;
+ int prior_recon;
RF_RowStatus_t rstat;
RF_SectorNum_t oo;
@@ -251,10 +250,11 @@ rf_RAID1DagSelect(
}
}
if (rf_dagDebug || rf_mapDebug) {
- rf_get_threadid(tid);
- printf("[%d] Redirected type '%c' r %d c %d o %ld -> r %d c %d o %ld\n",
- tid, type, or, oc, (long) oo, failedPDA->row, failedPDA->col,
- (long) failedPDA->startSector);
+ printf("raid%d: Redirected type '%c' r %d c %d o %ld -> r %d c %d o %ld\n",
+ raidPtr->raidid, type, or, oc,
+ (long) oo, failedPDA->row,
+ failedPDA->col,
+ (long) failedPDA->startSector);
}
asmap->numDataFailed = asmap->numParityFailed = 0;
}
@@ -277,7 +277,7 @@ rf_VerifyParityRAID1(
int correct_it,
RF_RaidAccessFlags_t flags)
{
- int nbytes, bcount, stripeWidth, ret, i, j, tid = 0, nbad, *bbufs;
+ int nbytes, bcount, stripeWidth, ret, i, j, nbad, *bbufs;
RF_DagNode_t *blockNode, *unblockNode, *wrBlock;
RF_DagHeader_t *rd_dag_h, *wr_dag_h;
RF_AccessStripeMapHeader_t *asm_h;
@@ -293,9 +293,6 @@ rf_VerifyParityRAID1(
RF_StripeNum_t psID;
RF_MCPair_t *mcpair;
- if (rf_verifyParityDebug) {
- rf_get_threadid(tid);
- }
layoutPtr = &raidPtr->Layout;
startAddr = rf_RaidAddressOfPrevStripeBoundary(layoutPtr, raidAddr);
nsector = parityPDA->numSector;
@@ -321,8 +318,9 @@ rf_VerifyParityRAID1(
if (buf == NULL)
goto done;
if (rf_verifyParityDebug) {
- printf("[%d] RAID1 parity verify: buf=%lx bcount=%d (%lx - %lx)\n",
- tid, (long) buf, bcount, (long) buf, (long) buf + bcount);
+ printf("raid%d: RAID1 parity verify: buf=%lx bcount=%d (%lx - %lx)\n",
+ raidPtr->raidid, (long) buf, bcount, (long) buf,
+ (long) buf + bcount);
}
/*
* Generate a DAG which will read the entire stripe- then we can
@@ -394,7 +392,8 @@ rf_VerifyParityRAID1(
rd_dag_h->tracerec = &tracerec;
if (rf_verifyParityDebug > 1) {
- printf("[%d] RAID1 parity verify read dag:\n", tid);
+ printf("raid%d: RAID1 parity verify read dag:\n",
+ raidPtr->raidid);
rf_PrintDAGList(rd_dag_h);
}
RF_LOCK_MUTEX(mcpair->mutex);
@@ -432,8 +431,9 @@ rf_VerifyParityRAID1(
*/
for (i = 0; i < layoutPtr->numDataCol; i++) {
if (rf_verifyParityDebug) {
- printf("[%d] RAID1 parity verify %d bytes: i=%d buf1=%lx buf2=%lx buf=%lx\n",
- tid, nbytes, i, (long) buf1, (long) buf2, (long) buf);
+ printf("raid%d: RAID1 parity verify %d bytes: i=%d buf1=%lx buf2=%lx buf=%lx\n",
+ raidPtr->raidid, nbytes, i, (long) buf1,
+ (long) buf2, (long) buf);
}
ret = bcmp(buf1, buf2, nbytes);
if (ret) {
@@ -449,7 +449,7 @@ rf_VerifyParityRAID1(
buf2[1] & 0xff, buf2[2] & 0xff, buf2[3] & 0xff, buf2[4] & 0xff);
}
if (rf_verifyParityDebug) {
- printf("[%d] RAID1: found bad parity, i=%d\n", tid, i);
+ printf("raid%d: RAID1: found bad parity, i=%d\n", raidPtr->raidid, i);
}
/*
* Parity is bad. Keep track of which columns were bad.
@@ -466,7 +466,7 @@ rf_VerifyParityRAID1(
if ((ret != RF_PARITY_OKAY) && correct_it) {
ret = RF_PARITY_COULD_NOT_CORRECT;
if (rf_verifyParityDebug) {
- printf("[%d] RAID1 parity verify: parity not correct\n", tid);
+ printf("raid%d: RAID1 parity verify: parity not correct\n", raidPtr->raidid);
}
if (bbufs == NULL)
goto done;
@@ -531,7 +531,8 @@ done:
rf_FreeMCPair(mcpair);
rf_FreeAllocList(allocList);
if (rf_verifyParityDebug) {
- printf("[%d] RAID1 parity verify, returning %d\n", tid, ret);
+ printf("raid%d: RAID1 parity verify, returning %d\n",
+ raidPtr->raidid, ret);
}
return (ret);
}
@@ -547,7 +548,7 @@ rf_SubmitReconBufferRAID1(rbuf, keep_it, use_committed)
RF_ReconParityStripeStatus_t *pssPtr;
RF_ReconCtrl_t *reconCtrlPtr;
RF_RaidLayout_t *layoutPtr;
- int tid = 0, retcode, created;
+ int retcode, created;
RF_CallbackDesc_t *cb, *p;
RF_ReconBuffer_t *t;
RF_Raid_t *raidPtr;
@@ -564,10 +565,10 @@ rf_SubmitReconBufferRAID1(rbuf, keep_it, use_committed)
RF_ASSERT(rbuf->col != reconCtrlPtr->fcol);
if (rf_reconbufferDebug) {
- rf_get_threadid(tid);
- printf("[%d] RAID1 reconbuffer submission r%d c%d psid %ld ru%d (failed offset %ld)\n",
- tid, rbuf->row, rbuf->col, (long) rbuf->parityStripeID, rbuf->which_ru,
- (long) rbuf->failedDiskSectorOffset);
+ printf("raid%d: RAID1 reconbuffer submission r%d c%d psid %ld ru%d (failed offset %ld)\n",
+ raidPtr->raidid, rbuf->row, rbuf->col,
+ (long) rbuf->parityStripeID, rbuf->which_ru,
+ (long) rbuf->failedDiskSectorOffset);
}
if (rf_reconDebug) {
printf("RAID1 reconbuffer submit psid %ld buf %lx\n",
@@ -594,13 +595,14 @@ rf_SubmitReconBufferRAID1(rbuf, keep_it, use_committed)
t = NULL;
if (keep_it) {
if (rf_reconbufferDebug) {
- printf("[%d] RAID1 rbuf submission: keeping rbuf\n", tid);
+ printf("raid%d: RAID1 rbuf submission: keeping rbuf\n",
+ raidPtr->raidid);
}
t = rbuf;
} else {
if (use_committed) {
if (rf_reconbufferDebug) {
- printf("[%d] RAID1 rbuf submission: using committed rbuf\n", tid);
+ printf("raid%d: RAID1 rbuf submission: using committed rbuf\n", raidPtr->raidid);
}
t = reconCtrlPtr->committedRbufs;
RF_ASSERT(t);
@@ -609,7 +611,7 @@ rf_SubmitReconBufferRAID1(rbuf, keep_it, use_committed)
} else
if (reconCtrlPtr->floatingRbufs) {
if (rf_reconbufferDebug) {
- printf("[%d] RAID1 rbuf submission: using floating rbuf\n", tid);
+ printf("raid%d: RAID1 rbuf submission: using floating rbuf\n", raidPtr->raidid);
}
t = reconCtrlPtr->floatingRbufs;
reconCtrlPtr->floatingRbufs = t->next;
@@ -618,7 +620,7 @@ rf_SubmitReconBufferRAID1(rbuf, keep_it, use_committed)
}
if (t == NULL) {
if (rf_reconbufferDebug) {
- printf("[%d] RAID1 rbuf submission: waiting for rbuf\n", tid);
+ printf("raid%d: RAID1 rbuf submission: waiting for rbuf\n", raidPtr->raidid);
}
RF_ASSERT((keep_it == 0) && (use_committed == 0));
raidPtr->procsInBufWait++;
@@ -678,7 +680,8 @@ out:
RF_UNLOCK_PSS_MUTEX(raidPtr, rbuf->row, rbuf->parityStripeID);
RF_UNLOCK_MUTEX(reconCtrlPtr->rb_mutex);
if (rf_reconbufferDebug) {
- printf("[%d] RAID1 rbuf submission: returning %d\n", tid, retcode);
+ printf("raid%d: RAID1 rbuf submission: returning %d\n",
+ raidPtr->raidid, retcode);
}
return (retcode);
}