diff options
| author | thorpej <thorpej@NetBSD.org> | 2001-09-01 23:50:43 +0000 |
|---|---|---|
| committer | thorpej <thorpej@NetBSD.org> | 2001-09-01 23:50:43 +0000 |
| commit | 1cbbd5c37c86337160b700d55a7d8876cbf4075f (patch) | |
| tree | 71fb2284c4ad9d3906fb45e212f49014ea716d7f /sys/dev/raidframe | |
| parent | 5f25c01eff0deaf9fe693d7d7e27e33a6b1cc233 (diff) | |
Disable all of the RF_ASSERT()s by default, enabling them if the
RAID_DIAGNOSTIC option is specified in the kernel configuration
file.
Diffstat (limited to 'sys/dev/raidframe')
| -rw-r--r-- | sys/dev/raidframe/rf_dagdegwr.c | 17 | ||||
| -rw-r--r-- | sys/dev/raidframe/rf_evenodd_dagfuncs.c | 10 | ||||
| -rw-r--r-- | sys/dev/raidframe/rf_general.h | 21 | ||||
| -rw-r--r-- | sys/dev/raidframe/rf_parityloggingdags.c | 4 | ||||
| -rw-r--r-- | sys/dev/raidframe/rf_stripelocks.c | 5 |
5 files changed, 32 insertions, 25 deletions
diff --git a/sys/dev/raidframe/rf_dagdegwr.c b/sys/dev/raidframe/rf_dagdegwr.c index 16534a49b12..2f4e6bc49e4 100644 --- a/sys/dev/raidframe/rf_dagdegwr.c +++ b/sys/dev/raidframe/rf_dagdegwr.c @@ -1,4 +1,4 @@ -/* $NetBSD: rf_dagdegwr.c,v 1.6 2001/01/26 04:05:08 oster Exp $ */ +/* $NetBSD: rf_dagdegwr.c,v 1.7 2001/09/01 23:50:44 thorpej Exp $ */ /* * Copyright (c) 1995 Carnegie-Mellon University. * All rights reserved. @@ -87,13 +87,12 @@ rf_CreateDegradedWriteDAG(raidPtr, asmap, dag_h, bp, flags, allocList) RF_RaidAccessFlags_t flags; RF_AllocListElem_t *allocList; { - RF_RaidLayout_t *layoutPtr = &(raidPtr->Layout); - RF_PhysDiskAddr_t *failedPDA = asmap->failedPDAs[0]; RF_ASSERT(asmap->numDataFailed == 1); dag_h->creator = "DegradedWriteDAG"; - /* if the access writes only a portion of the failed unit, and also + /* + * if the access writes only a portion of the failed unit, and also * writes some portion of at least one surviving unit, we create two * DAGs, one for the failed component and one for the non-failed * component, and do them sequentially. Note that the fact that we're @@ -101,9 +100,13 @@ rf_CreateDegradedWriteDAG(raidPtr, asmap, dag_h, bp, flags, allocList) * access either starts or ends in the failed unit, and hence we need * create only two dags. This is inefficient in that the same data or * parity can get read and written twice using this structure. I need - * to fix this to do the access all at once. */ - RF_ASSERT(!(asmap->numStripeUnitsAccessed != 1 && failedPDA->numSector != layoutPtr->sectorsPerStripeUnit)); - rf_CreateSimpleDegradedWriteDAG(raidPtr, asmap, dag_h, bp, flags, allocList); + * to fix this to do the access all at once. + */ + RF_ASSERT(!(asmap->numStripeUnitsAccessed != 1 && + asmap->failedPDAs[0]->numSector != + raidPtr->Layout.sectorsPerStripeUnit)); + rf_CreateSimpleDegradedWriteDAG(raidPtr, asmap, dag_h, bp, flags, + allocList); } diff --git a/sys/dev/raidframe/rf_evenodd_dagfuncs.c b/sys/dev/raidframe/rf_evenodd_dagfuncs.c index f933e1c2c5d..787d93c06d5 100644 --- a/sys/dev/raidframe/rf_evenodd_dagfuncs.c +++ b/sys/dev/raidframe/rf_evenodd_dagfuncs.c @@ -1,4 +1,4 @@ -/* $NetBSD: rf_evenodd_dagfuncs.c,v 1.8 2001/07/18 06:45:33 thorpej Exp $ */ +/* $NetBSD: rf_evenodd_dagfuncs.c,v 1.9 2001/09/01 23:50:44 thorpej Exp $ */ /* * Copyright (c) 1995 Carnegie-Mellon University. * All rights reserved. @@ -104,8 +104,12 @@ rf_RegularONEFunc(node) char *srcbuf, *destbuf; RF_AccTraceEntry_t *tracerec = node->dagHdr->tracerec; RF_Etimer_t timer; - RF_PhysDiskAddr_t *pda, *EPDA = (RF_PhysDiskAddr_t *) node->params[EpdaIndex].p; - int ESUOffset = rf_StripeUnitOffset(layoutPtr, EPDA->startSector); /* generally zero */ + RF_PhysDiskAddr_t *pda; +#ifdef RAID_DIAGNOSTIC + RF_PhysDiskAddr_t *EPDA = + (RF_PhysDiskAddr_t *) node->params[EpdaIndex].p; + int ESUOffset = rf_StripeUnitOffset(layoutPtr, EPDA->startSector); +#endif /* RAID_DIAGNOSTIC */ RF_ASSERT(EPDA->type == RF_PDA_TYPE_Q); RF_ASSERT(ESUOffset == 0); diff --git a/sys/dev/raidframe/rf_general.h b/sys/dev/raidframe/rf_general.h index 1a6fd0be761..9a2c6c70832 100644 --- a/sys/dev/raidframe/rf_general.h +++ b/sys/dev/raidframe/rf_general.h @@ -1,4 +1,4 @@ -/* $NetBSD: rf_general.h,v 1.7 2001/07/18 06:45:33 thorpej Exp $ */ +/* $NetBSD: rf_general.h,v 1.8 2001/09/01 23:50:44 thorpej Exp $ */ /* * Copyright (c) 1995 Carnegie-Mellon University. * All rights reserved. @@ -30,11 +30,13 @@ * rf_general.h -- some general-use definitions */ -/*#define NOASSERT*/ - #ifndef _RF__RF_GENERAL_H_ #define _RF__RF_GENERAL_H_ +#ifdef _KERNEL_OPT +#include "opt_raid_diagnostic.h" +#endif /* _KERNEL_OPT */ + /* error reporting and handling */ #ifdef _KERNEL @@ -52,23 +54,20 @@ void rf_print_assert_panic_message(int, char *, char *); extern char rf_panicbuf[]; #define RF_PANIC() {rf_print_panic_message(__LINE__,__FILE__); panic(rf_panicbuf);} +#ifdef RAID_DIAGNOSTIC #ifdef _KERNEL -#ifdef RF_ASSERT -#undef RF_ASSERT -#endif /* RF_ASSERT */ -#ifndef NOASSERT #define RF_ASSERT(_x_) { \ if (!(_x_)) { \ rf_print_assert_panic_message(__LINE__, __FILE__, #_x_); \ panic(rf_panicbuf); \ } \ } -#else /* !NOASSERT */ +#else /* _KERNEL */ #define RF_ASSERT(x) {/*noop*/} -#endif /* !NOASSERT */ -#else /* _KERNEL */ +#endif /* _KERNEL */ +#else /* RAID_DIAGNOSTIC */ #define RF_ASSERT(x) {/*noop*/} -#endif /* _KERNEL */ +#endif /* RAID_DIAGNOSTIC */ /* random stuff */ #define RF_MAX(a,b) (((a) > (b)) ? (a) : (b)) diff --git a/sys/dev/raidframe/rf_parityloggingdags.c b/sys/dev/raidframe/rf_parityloggingdags.c index 34ace7cf491..ed308c1e542 100644 --- a/sys/dev/raidframe/rf_parityloggingdags.c +++ b/sys/dev/raidframe/rf_parityloggingdags.c @@ -1,4 +1,4 @@ -/* $NetBSD: rf_parityloggingdags.c,v 1.4 2000/01/07 03:41:04 oster Exp $ */ +/* $NetBSD: rf_parityloggingdags.c,v 1.5 2001/09/01 23:50:44 thorpej Exp $ */ /* * Copyright (c) 1995 Carnegie-Mellon University. * All rights reserved. @@ -332,7 +332,9 @@ rf_CommonCreateParityLoggingSmallWriteDAG( int (*qfunc) (RF_DagNode_t * node); char *name, *qname; RF_StripeNum_t parityStripeID = rf_RaidAddressToParityStripeID(&(raidPtr->Layout), asmap->raidAddress, &which_ru); +#ifdef RAID_DIAGNOSTIC long nfaults = qfuncs ? 2 : 1; +#endif /* RAID_DIAGNOSTIC */ int lu_flag = (rf_enableAtomicRMW) ? 1 : 0; /* lock/unlock flag */ if (rf_dagDebug) diff --git a/sys/dev/raidframe/rf_stripelocks.c b/sys/dev/raidframe/rf_stripelocks.c index 1bfd15e7857..ebdfb85f9b1 100644 --- a/sys/dev/raidframe/rf_stripelocks.c +++ b/sys/dev/raidframe/rf_stripelocks.c @@ -1,4 +1,4 @@ -/* $NetBSD: rf_stripelocks.c,v 1.6 2000/12/04 11:35:46 fvdl Exp $ */ +/* $NetBSD: rf_stripelocks.c,v 1.7 2001/09/01 23:50:44 thorpej Exp $ */ /* * Copyright (c) 1995 Carnegie-Mellon University. * All rights reserved. @@ -336,12 +336,11 @@ rf_ReleaseStripeLock( { RF_StripeLockDesc_t *lockDesc, *ld_t; RF_LockReqDesc_t *lr, *lr_t, *callbacklist, *t; - RF_IoType_t type = lockReqDesc->type; int tid = 0, hashval = HASH_STRIPEID(stripeID); int release_it, consider_it; RF_LockReqDesc_t *candidate, *candidate_t, *predecessor; - RF_ASSERT(RF_IO_IS_R_OR_W(type)); + RF_ASSERT(RF_IO_IS_R_OR_W(lockReqDesc->type)); if (rf_stripeLockDebug) { if (stripeID == -1) |
