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 some unused code which, were it enabl...



details:   https://anonhg.NetBSD.org/src/rev/f65aa401606d
branches:  trunk
changeset: 475806:f65aa401606d
user:      oster <oster%NetBSD.org@localhost>
date:      Thu Aug 26 02:40:27 1999 +0000

description:
Nuke some unused code which, were it enabled, might be useful for
performance measurement, but which would cause data corruption.

diffstat:

 sys/dev/raidframe/rf_archs.h    |   13 +----
 sys/dev/raidframe/rf_dagffwr.c  |   22 +--------
 sys/dev/raidframe/rf_dagfuncs.c |  103 +---------------------------------------
 3 files changed, 4 insertions(+), 134 deletions(-)

diffs (251 lines):

diff -r c7f4470d8d48 -r f65aa401606d sys/dev/raidframe/rf_archs.h
--- a/sys/dev/raidframe/rf_archs.h      Thu Aug 26 02:15:35 1999 +0000
+++ b/sys/dev/raidframe/rf_archs.h      Thu Aug 26 02:40:27 1999 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: rf_archs.h,v 1.5 1999/08/03 22:07:39 oster Exp $       */
+/*     $NetBSD: rf_archs.h,v 1.6 1999/08/26 02:40:27 oster Exp $       */
 /*
  * Copyright (c) 1995 Carnegie-Mellon University.
  * All rights reserved.
@@ -75,17 +75,6 @@
 
 #define RF_KEEP_DISKSTATS 1
 
-/* These two symbols enable nonstandard forms of error recovery.
- * These modes are only valid for performance measurements and
- * data corruption will occur if an error occurs when either
- * forward or backward error recovery are enabled.  In general
- * both of the following two definitions should be commented
- * out--this forces RAIDframe to use roll-away error recovery
- * which does guarantee proper error recovery without data corruption
- */
-/* #define RF_FORWARD 1 */
-/* #define RF_BACKWARD 1 */
-
 #include "rf_options.h"
 
 #endif                         /* !_RF__RF_ARCHS_H_ */
diff -r c7f4470d8d48 -r f65aa401606d sys/dev/raidframe/rf_dagffwr.c
--- a/sys/dev/raidframe/rf_dagffwr.c    Thu Aug 26 02:15:35 1999 +0000
+++ b/sys/dev/raidframe/rf_dagffwr.c    Thu Aug 26 02:40:27 1999 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: rf_dagffwr.c,v 1.3 1999/02/05 00:06:07 oster Exp $     */
+/*     $NetBSD: rf_dagffwr.c,v 1.4 1999/08/26 02:40:28 oster Exp $     */
 /*
  * Copyright (c) 1995 Carnegie-Mellon University.
  * All rights reserved.
@@ -110,19 +110,9 @@
     RF_RaidAccessFlags_t flags,
     RF_AllocListElem_t * allocList)
 {
-#if RF_FORWARD > 0
-       rf_CommonCreateSmallWriteDAGFwd(raidPtr, asmap, dag_h, bp, flags, allocList,
-           &rf_xorFuncs, NULL);
-#else                          /* RF_FORWARD > 0 */
-#if RF_BACKWARD > 0
-       rf_CommonCreateSmallWriteDAGFwd(raidPtr, asmap, dag_h, bp, flags, allocList,
-           &rf_xorFuncs, NULL);
-#else                          /* RF_BACKWARD > 0 */
        /* "normal" rollaway */
        rf_CommonCreateSmallWriteDAG(raidPtr, asmap, dag_h, bp, flags, allocList,
            &rf_xorFuncs, NULL);
-#endif                         /* RF_BACKWARD > 0 */
-#endif                         /* RF_FORWARD > 0 */
 }
 
 void 
@@ -134,19 +124,9 @@
     RF_RaidAccessFlags_t flags,
     RF_AllocListElem_t * allocList)
 {
-#if RF_FORWARD > 0
-       rf_CommonCreateLargeWriteDAGFwd(raidPtr, asmap, dag_h, bp, flags, allocList,
-           1, rf_RegularXorFunc, RF_TRUE);
-#else                          /* RF_FORWARD > 0 */
-#if RF_BACKWARD > 0
-       rf_CommonCreateLargeWriteDAGFwd(raidPtr, asmap, dag_h, bp, flags, allocList,
-           1, rf_RegularXorFunc, RF_TRUE);
-#else                          /* RF_BACKWARD > 0 */
        /* "normal" rollaway */
        rf_CommonCreateLargeWriteDAG(raidPtr, asmap, dag_h, bp, flags, allocList,
            1, rf_RegularXorFunc, RF_TRUE);
-#endif                         /* RF_BACKWARD > 0 */
-#endif                         /* RF_FORWARD > 0 */
 }
 
 
diff -r c7f4470d8d48 -r f65aa401606d sys/dev/raidframe/rf_dagfuncs.c
--- a/sys/dev/raidframe/rf_dagfuncs.c   Thu Aug 26 02:15:35 1999 +0000
+++ b/sys/dev/raidframe/rf_dagfuncs.c   Thu Aug 26 02:40:27 1999 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: rf_dagfuncs.c,v 1.4 1999/03/14 21:53:31 oster Exp $    */
+/*     $NetBSD: rf_dagfuncs.c,v 1.5 1999/08/26 02:40:28 oster Exp $    */
 /*
  * Copyright (c) 1995 Carnegie-Mellon University.
  * All rights reserved.
@@ -293,9 +293,6 @@
        RF_IoType_t iotype = (node->dagHdr->status == rf_enable) ? RF_IO_TYPE_READ : RF_IO_TYPE_NOP;
        RF_DiskQueue_t **dqs = ((RF_Raid_t *) (node->dagHdr->raidPtr))->Queues;
        void   *b_proc = NULL;
-#if RF_BACKWARD > 0
-       caddr_t undoBuf;
-#endif
 
        if (node->dagHdr->bp)
                b_proc = (void *) ((struct buf *) node->dagHdr->bp)->b_proc;
@@ -303,14 +300,7 @@
        RF_ASSERT(!(lock && unlock));
        flags |= (lock) ? RF_LOCK_DISK_QUEUE : 0;
        flags |= (unlock) ? RF_UNLOCK_DISK_QUEUE : 0;
-#if RF_BACKWARD > 0
-       /* allocate and zero the undo buffer. this is equivalent to copying
-        * the original buffer's contents to the undo buffer prior to
-        * performing the disk read. XXX hardcoded 512 bytes per sector! */
-       if (node->dagHdr->allocList == NULL)
-               rf_MakeAllocList(node->dagHdr->allocList);
-       RF_CallocAndAdd(undoBuf, 1, 512 * pda->numSector, (caddr_t), node->dagHdr->allocList);
-#endif                         /* RF_BACKWARD > 0 */
+
        req = rf_CreateDiskQueueData(iotype, pda->startSector, pda->numSector,
            buf, parityStripeID, which_ru,
            (int (*) (void *, int)) node->wakeFunc,
@@ -345,59 +335,10 @@
        RF_IoType_t iotype = (node->dagHdr->status == rf_enable) ? RF_IO_TYPE_WRITE : RF_IO_TYPE_NOP;
        RF_DiskQueue_t **dqs = ((RF_Raid_t *) (node->dagHdr->raidPtr))->Queues;
        void   *b_proc = NULL;
-#if RF_BACKWARD > 0
-       caddr_t undoBuf;
-#endif
 
        if (node->dagHdr->bp)
                b_proc = (void *) ((struct buf *) node->dagHdr->bp)->b_proc;
 
-#if RF_BACKWARD > 0
-       /* This area is used only for backward error recovery experiments
-        * First, schedule allocate a buffer and schedule a pre-read of the
-        * disk After the pre-read, proceed with the normal disk write */
-       if (node->status == rf_bwd2) {
-               /* just finished undo logging, now perform real function */
-               node->status = rf_fired;
-               RF_ASSERT(!(lock && unlock));
-               flags |= (lock) ? RF_LOCK_DISK_QUEUE : 0;
-               flags |= (unlock) ? RF_UNLOCK_DISK_QUEUE : 0;
-               req = rf_CreateDiskQueueData(iotype,
-                   pda->startSector, pda->numSector, buf, parityStripeID, which_ru,
-                   node->wakeFunc, (void *) node, NULL, node->dagHdr->tracerec,
-                   (void *) (node->dagHdr->raidPtr), flags, b_proc);
-
-               if (!req) {
-                       (node->wakeFunc) (node, ENOMEM);
-               } else {
-                       node->dagFuncData = (void *) req;
-                       rf_DiskIOEnqueue(&(dqs[pda->row][pda->col]), req, priority);
-               }
-       } else {
-               /* node status should be rf_fired */
-               /* schedule a disk pre-read */
-               node->status = rf_bwd1;
-               RF_ASSERT(!(lock && unlock));
-               flags |= (lock) ? RF_LOCK_DISK_QUEUE : 0;
-               flags |= (unlock) ? RF_UNLOCK_DISK_QUEUE : 0;
-               if (node->dagHdr->allocList == NULL)
-                       rf_MakeAllocList(node->dagHdr->allocList);
-               RF_CallocAndAdd(undoBuf, 1, 512 * pda->numSector, (caddr_t), node->dagHdr->allocList);
-               req = rf_CreateDiskQueueData(RF_IO_TYPE_READ,
-                   pda->startSector, pda->numSector, undoBuf, parityStripeID, which_ru,
-                   node->wakeFunc, (void *) node, NULL, node->dagHdr->tracerec,
-                   (void *) (node->dagHdr->raidPtr), flags, b_proc);
-
-               if (!req) {
-                       (node->wakeFunc) (node, ENOMEM);
-               } else {
-                       node->dagFuncData = (void *) req;
-                       rf_DiskIOEnqueue(&(dqs[pda->row][pda->col]), req, priority);
-               }
-       }
-       return (0);
-#endif                         /* RF_BACKWARD > 0 */
-
        /* normal processing (rollaway or forward recovery) begins here */
        RF_ASSERT(!(lock && unlock));
        flags |= (lock) ? RF_LOCK_DISK_QUEUE : 0;
@@ -548,10 +489,6 @@
        RF_AccTraceEntry_t *tracerec = node->dagHdr->tracerec;
        RF_Etimer_t timer;
        int     i, retcode;
-#if RF_BACKWARD > 0
-       RF_PhysDiskAddr_t *pda;
-       caddr_t undoBuf;
-#endif
 
        retcode = 0;
        if (node->dagHdr->status == rf_enable) {
@@ -559,16 +496,6 @@
                RF_ETIMER_START(timer);
                for (i = 0; i < node->numParams - 1; i += 2)
                        if (node->params[i + 1].p != node->results[0]) {
-#if RF_BACKWARD > 0
-                               /* This section mimics undo logging for
-                                * backward error recovery experiments b
-                                * allocating and initializing a buffer XXX
-                                * 512 byte sector size is hard coded! */
-                               pda = node->params[i].p;
-                               if (node->dagHdr->allocList == NULL)
-                                       rf_MakeAllocList(node->dagHdr->allocList);
-                               RF_CallocAndAdd(undoBuf, 1, 512 * pda->numSector, (caddr_t), node->dagHdr->allocList);
-#endif                         /* RF_BACKWARD > 0 */
                                retcode = rf_XorIntoBuffer(raidPtr, (RF_PhysDiskAddr_t *) node->params[i].p,
                                    (char *) node->params[i + 1].p, (char *) node->results[0], node->dagHdr->bp);
                        }
@@ -589,26 +516,12 @@
        int     i, retcode = 0;
        RF_AccTraceEntry_t *tracerec = node->dagHdr->tracerec;
        RF_Etimer_t timer;
-#if RF_BACKWARD > 0
-       RF_PhysDiskAddr_t *pda;
-       caddr_t undoBuf;
-#endif
 
        if (node->dagHdr->status == rf_enable) {
                RF_ETIMER_START(timer);
                /* don't do the XOR if the input is the same as the output */
                for (i = 0; i < node->numParams - 1; i += 2)
                        if (node->params[i + 1].p != node->results[0]) {
-#if RF_BACKWARD > 0
-                               /* This section mimics undo logging for
-                                * backward error recovery experiments b
-                                * allocating and initializing a buffer XXX
-                                * 512 byte sector size is hard coded! */
-                               pda = node->params[i].p;
-                               if (node->dagHdr->allocList == NULL)
-                                       rf_MakeAllocList(node->dagHdr->allocList);
-                               RF_CallocAndAdd(undoBuf, 1, 512 * pda->numSector, (caddr_t), node->dagHdr->allocList);
-#endif                         /* RF_BACKWARD > 0 */
                                retcode = rf_bxor((char *) node->params[i + 1].p, (char *) node->results[0],
                                    rf_RaidAddressToByte(raidPtr, ((RF_PhysDiskAddr_t *) node->params[i].p)->numSector),
                                    (struct buf *) node->dagHdr->bp);
@@ -641,24 +554,12 @@
        char   *srcbuf, *destbuf;
        RF_AccTraceEntry_t *tracerec = node->dagHdr->tracerec;
        RF_Etimer_t timer;
-#if RF_BACKWARD > 0
-       caddr_t undoBuf;
-#endif
 
        if (node->dagHdr->status == rf_enable) {
                RF_ETIMER_START(timer);
                for (i = 0; i < node->numParams - 2; i += 2)
                        if (node->params[i + 1].p != node->results[0]) {
                                pda = (RF_PhysDiskAddr_t *) node->params[i].p;
-#if RF_BACKWARD > 0
-                               /* This section mimics undo logging for
-                                * backward error recovery experiments b
-                                * allocating and initializing a buffer XXX
-                                * 512 byte sector size is hard coded! */
-                               if (node->dagHdr->allocList == NULL)
-                                       rf_MakeAllocList(node->dagHdr->allocList);
-                               RF_CallocAndAdd(undoBuf, 1, 512 * pda->numSector, (caddr_t), node->dagHdr->allocList);
-#endif                         /* RF_BACKWARD > 0 */
                                srcbuf = (char *) node->params[i + 1].p;
                                suoffset = rf_StripeUnitOffset(layoutPtr, pda->startSector);
                                destbuf = ((char *) node->results[0]) + rf_RaidAddressToByte(raidPtr, suoffset - failedSUOffset);



Home | Main Index | Thread Index | Old Index