Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys Disable all of the RF_ASSERT()s by default, enabling the...



details:   https://anonhg.NetBSD.org/src/rev/7d1fb2269882
branches:  trunk
changeset: 514407:7d1fb2269882
user:      thorpej <thorpej%NetBSD.org@localhost>
date:      Sat Sep 01 23:50:43 2001 +0000

description:
Disable all of the RF_ASSERT()s by default, enabling them if the
RAID_DIAGNOSTIC option is specified in the kernel configuration
file.

diffstat:

 sys/conf/files                           |   3 ++-
 sys/dev/raidframe/rf_dagdegwr.c          |  17 ++++++++++-------
 sys/dev/raidframe/rf_evenodd_dagfuncs.c  |  10 +++++++---
 sys/dev/raidframe/rf_general.h           |  21 ++++++++++-----------
 sys/dev/raidframe/rf_parityloggingdags.c |   4 +++-
 sys/dev/raidframe/rf_stripelocks.c       |   5 ++---
 6 files changed, 34 insertions(+), 26 deletions(-)

diffs (179 lines):

diff -r d1e2ee87df1d -r 7d1fb2269882 sys/conf/files
--- a/sys/conf/files    Sat Sep 01 23:08:40 2001 +0000
+++ b/sys/conf/files    Sat Sep 01 23:50:43 2001 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: files,v 1.454 2001/08/17 00:48:29 thorpej Exp $
+#      $NetBSD: files,v 1.455 2001/09/01 23:50:43 thorpej Exp $
 
 #      @(#)files.newconf       7.5 (Berkeley) 5/10/93
 
@@ -122,6 +122,7 @@
 
 # RAIDframe options
 defopt RAID_AUTOCONFIG
+defopt RAID_DIAGNOSTIC
 
 # buffer cache size options
 defopt opt_bufcache.h  BUFCACHE BUFPAGES
diff -r d1e2ee87df1d -r 7d1fb2269882 sys/dev/raidframe/rf_dagdegwr.c
--- a/sys/dev/raidframe/rf_dagdegwr.c   Sat Sep 01 23:08:40 2001 +0000
+++ b/sys/dev/raidframe/rf_dagdegwr.c   Sat Sep 01 23:50:43 2001 +0000
@@ -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_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 @@
         * 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 -r d1e2ee87df1d -r 7d1fb2269882 sys/dev/raidframe/rf_evenodd_dagfuncs.c
--- a/sys/dev/raidframe/rf_evenodd_dagfuncs.c   Sat Sep 01 23:08:40 2001 +0000
+++ b/sys/dev/raidframe/rf_evenodd_dagfuncs.c   Sat Sep 01 23:50:43 2001 +0000
@@ -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 @@
        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 -r d1e2ee87df1d -r 7d1fb2269882 sys/dev/raidframe/rf_general.h
--- a/sys/dev/raidframe/rf_general.h    Sat Sep 01 23:08:40 2001 +0000
+++ b/sys/dev/raidframe/rf_general.h    Sat Sep 01 23:50:43 2001 +0000
@@ -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 @@
 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 -r d1e2ee87df1d -r 7d1fb2269882 sys/dev/raidframe/rf_parityloggingdags.c
--- a/sys/dev/raidframe/rf_parityloggingdags.c  Sat Sep 01 23:08:40 2001 +0000
+++ b/sys/dev/raidframe/rf_parityloggingdags.c  Sat Sep 01 23:50:43 2001 +0000
@@ -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 @@
        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 -r d1e2ee87df1d -r 7d1fb2269882 sys/dev/raidframe/rf_stripelocks.c
--- a/sys/dev/raidframe/rf_stripelocks.c        Sat Sep 01 23:08:40 2001 +0000
+++ b/sys/dev/raidframe/rf_stripelocks.c        Sat Sep 01 23:50:43 2001 +0000
@@ -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_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)



Home | Main Index | Thread Index | Old Index