Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/raidframe Partially back out some changes that were ...



details:   https://anonhg.NetBSD.org/src/rev/bfe5f2abd501
branches:  trunk
changeset: 559784:bfe5f2abd501
user:      oster <oster%NetBSD.org@localhost>
date:      Tue Mar 23 21:53:36 2004 +0000

description:
Partially back out some changes that were causing grief with
RAID5 sets with more than 3 drives.  Still need to figure out why
the original changes were losing, but need the version in tree reliable
first!

Huge THANKS to Juergen Hannken-Illjes for helping track down
the changes that were causing the lossage.

diffstat:

 sys/dev/raidframe/rf_dagdegwr.c |   7 +++----
 sys/dev/raidframe/rf_dagffwr.c  |  13 +++++--------
 sys/dev/raidframe/rf_dagutils.c |  26 ++++++++++++++++++--------
 sys/dev/raidframe/rf_dagutils.h |   5 +++--
 4 files changed, 29 insertions(+), 22 deletions(-)

diffs (177 lines):

diff -r 5e0f33753387 -r bfe5f2abd501 sys/dev/raidframe/rf_dagdegwr.c
--- a/sys/dev/raidframe/rf_dagdegwr.c   Tue Mar 23 21:53:34 2004 +0000
+++ b/sys/dev/raidframe/rf_dagdegwr.c   Tue Mar 23 21:53:36 2004 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: rf_dagdegwr.c,v 1.22 2004/03/21 03:22:08 oster Exp $   */
+/*     $NetBSD: rf_dagdegwr.c,v 1.23 2004/03/23 21:53:36 oster Exp $   */
 /*
  * Copyright (c) 1995 Carnegie-Mellon University.
  * All rights reserved.
@@ -34,7 +34,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: rf_dagdegwr.c,v 1.22 2004/03/21 03:22:08 oster Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rf_dagdegwr.c,v 1.23 2004/03/23 21:53:36 oster Exp $");
 
 #include <dev/raidframe/raidframevar.h>
 
@@ -368,8 +368,7 @@
        parityPDA->numSector = failedPDA->numSector;
 
        if (!xorTargetBuf) {
-               xorTargetBuf = rf_AllocBuffer(raidPtr, dag_h,
-                                             rf_RaidAddressToByte(raidPtr, failedPDA->numSector));
+               xorTargetBuf = rf_AllocBuffer(raidPtr, rf_RaidAddressToByte(raidPtr, failedPDA->numSector), allocList);
        }
        /* init the Wnp node */
        rf_InitNode(wnpNode, rf_wait, RF_FALSE, rf_DiskWriteFunc, rf_DiskWriteUndoFunc,
diff -r 5e0f33753387 -r bfe5f2abd501 sys/dev/raidframe/rf_dagffwr.c
--- a/sys/dev/raidframe/rf_dagffwr.c    Tue Mar 23 21:53:34 2004 +0000
+++ b/sys/dev/raidframe/rf_dagffwr.c    Tue Mar 23 21:53:36 2004 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: rf_dagffwr.c,v 1.24 2004/03/20 05:21:53 oster Exp $    */
+/*     $NetBSD: rf_dagffwr.c,v 1.25 2004/03/23 21:53:36 oster Exp $    */
 /*
  * Copyright (c) 1995 Carnegie-Mellon University.
  * All rights reserved.
@@ -34,7 +34,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: rf_dagffwr.c,v 1.24 2004/03/20 05:21:53 oster Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rf_dagffwr.c,v 1.25 2004/03/23 21:53:36 oster Exp $");
 
 #include <dev/raidframe/raidframevar.h>
 
@@ -351,8 +351,7 @@
                }
        }
        if ((!allowBufferRecycle) || (i == nRodNodes)) {
-               xorNode->results[0] = rf_AllocBuffer(raidPtr, dag_h,
-                                                      rf_RaidAddressToByte(raidPtr, raidPtr->Layout.sectorsPerStripeUnit));
+               xorNode->results[0] = rf_AllocBuffer(raidPtr, rf_RaidAddressToByte(raidPtr, raidPtr->Layout.sectorsPerStripeUnit), allocList);
        } else {
                /* this works because the only way we get here is if
                   allowBufferRecycle is true and we went through the
@@ -694,8 +693,7 @@
                /* physical disk addr desc */
                tmpreadDataNode->params[0].p = pda;
                /* buffer to hold old data */
-               tmpreadDataNode->params[1].p = rf_AllocBuffer(raidPtr, dag_h, 
-                                                             pda->numSector << raidPtr->logBytesPerSector);
+               tmpreadDataNode->params[1].p = rf_AllocBuffer(raidPtr, pda->numSector << raidPtr->logBytesPerSector, allocList);
                tmpreadDataNode->params[2].v = parityStripeID;
                tmpreadDataNode->params[3].v = RF_CREATE_PARAM3(RF_IO_NORMAL_PRIORITY,
                    which_ru);
@@ -718,8 +716,7 @@
                            dag_h, "Rop", allocList);
                tmpreadParityNode->params[0].p = pda;
                /* buffer to hold old parity */
-               tmpreadParityNode->params[1].p = rf_AllocBuffer(raidPtr, dag_h,
-                                                               pda->numSector << raidPtr->logBytesPerSector);
+               tmpreadParityNode->params[1].p = rf_AllocBuffer(raidPtr, pda->numSector << raidPtr->logBytesPerSector, allocList);
                tmpreadParityNode->params[2].v = parityStripeID;
                tmpreadParityNode->params[3].v = RF_CREATE_PARAM3(RF_IO_NORMAL_PRIORITY,
                    which_ru);
diff -r 5e0f33753387 -r bfe5f2abd501 sys/dev/raidframe/rf_dagutils.c
--- a/sys/dev/raidframe/rf_dagutils.c   Tue Mar 23 21:53:34 2004 +0000
+++ b/sys/dev/raidframe/rf_dagutils.c   Tue Mar 23 21:53:36 2004 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: rf_dagutils.c,v 1.42 2004/03/20 05:21:53 oster Exp $   */
+/*     $NetBSD: rf_dagutils.c,v 1.43 2004/03/23 21:53:36 oster Exp $   */
 /*
  * Copyright (c) 1995 Carnegie-Mellon University.
  * All rights reserved.
@@ -33,7 +33,7 @@
  *****************************************************************************/
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: rf_dagutils.c,v 1.42 2004/03/20 05:21:53 oster Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rf_dagutils.c,v 1.43 2004/03/23 21:53:36 oster Exp $");
 
 #include <dev/raidframe/raidframevar.h>
 
@@ -355,8 +355,18 @@
 caller (ie. the data of the associated PDA).  Glue this buffer
 into our dag_h cleanup structure. */
 
+void *
+rf_AllocBuffer(RF_Raid_t *raidPtr, int size, RF_AllocListElem_t * allocList)
+{
+       void *p;
+       
+       RF_MallocAndAdd(p, size, (char *), allocList);
+        return ((void *) p);
+}
+
+
 void   *
-rf_AllocBuffer(RF_Raid_t *raidPtr, RF_DagHeader_t *dag_h, int size)
+rf_AllocBuffer2(RF_Raid_t *raidPtr, RF_DagHeader_t *dag_h, int size)
 {
        RF_VoidPointerListElem_t *vple;
        void *p;
@@ -954,7 +964,7 @@
        if (!rf_RaidAddressStripeAligned(layoutPtr, asmap->raidAddress)) {
                sosRaidAddress = rf_RaidAddressOfPrevStripeBoundary(layoutPtr, asmap->raidAddress);
                sosNumSector = asmap->raidAddress - sosRaidAddress;
-               *sosBuffer = rf_AllocBuffer(raidPtr, dag_h, rf_RaidAddressToByte(raidPtr, sosNumSector));
+               *sosBuffer = rf_AllocBuffer(raidPtr, rf_RaidAddressToByte(raidPtr, sosNumSector), allocList);
                new_asm_h[0] = rf_MapAccess(raidPtr, sosRaidAddress, sosNumSector, *sosBuffer, RF_DONT_REMAP);
                new_asm_h[0]->next = dag_h->asmList;
                dag_h->asmList = new_asm_h[0];
@@ -970,7 +980,7 @@
        if (!rf_RaidAddressStripeAligned(layoutPtr, asmap->endRaidAddress)) {
                eosRaidAddress = asmap->endRaidAddress;
                eosNumSector = rf_RaidAddressOfNextStripeBoundary(layoutPtr, eosRaidAddress) - eosRaidAddress;
-               *eosBuffer = rf_AllocBuffer(raidPtr, dag_h, rf_RaidAddressToByte(raidPtr, eosNumSector));
+               *eosBuffer = rf_AllocBuffer(raidPtr, rf_RaidAddressToByte(raidPtr, eosNumSector), allocList);
                new_asm_h[1] = rf_MapAccess(raidPtr, eosRaidAddress, eosNumSector, *eosBuffer, RF_DONT_REMAP);
                new_asm_h[1]->next = dag_h->asmList;
                dag_h->asmList = new_asm_h[1];
@@ -1071,7 +1081,7 @@
                dag_h->asmList = new_asm_h[0];
                for (pda = new_asm_h[0]->stripeMap->physInfo; pda; pda = pda->next) {
                        rf_RangeRestrictPDA(raidPtr, failedPDA, pda, RF_RESTRICT_NOBUFFER, 0);
-                       pda->bufPtr = rf_AllocBuffer(raidPtr, dag_h, pda->numSector << raidPtr->logBytesPerSector);
+                       pda->bufPtr = rf_AllocBuffer(raidPtr, pda->numSector << raidPtr->logBytesPerSector, allocList);
                }
                (*nXorBufs) += new_asm_h[0]->stripeMap->numStripeUnitsAccessed;
        }
@@ -1080,14 +1090,14 @@
                dag_h->asmList = new_asm_h[1];
                for (pda = new_asm_h[1]->stripeMap->physInfo; pda; pda = pda->next) {
                        rf_RangeRestrictPDA(raidPtr, failedPDA, pda, RF_RESTRICT_NOBUFFER, 0);
-                       pda->bufPtr = rf_AllocBuffer(raidPtr, dag_h, pda->numSector << raidPtr->logBytesPerSector);
+                       pda->bufPtr = rf_AllocBuffer(raidPtr, pda->numSector << raidPtr->logBytesPerSector, allocList);
                }
                (*nXorBufs) += new_asm_h[1]->stripeMap->numStripeUnitsAccessed;
        }
        
        /* allocate a buffer for parity */
        if (rpBufPtr) 
-               *rpBufPtr = rf_AllocBuffer(raidPtr, dag_h, failedPDA->numSector << raidPtr->logBytesPerSector);
+               *rpBufPtr = rf_AllocBuffer(raidPtr, failedPDA->numSector << raidPtr->logBytesPerSector, allocList);
 
        /* the last step is to figure out how many more distinct buffers need
         * to get xor'd to produce the missing unit.  there's one for each
diff -r 5e0f33753387 -r bfe5f2abd501 sys/dev/raidframe/rf_dagutils.h
--- a/sys/dev/raidframe/rf_dagutils.h   Tue Mar 23 21:53:34 2004 +0000
+++ b/sys/dev/raidframe/rf_dagutils.h   Tue Mar 23 21:53:36 2004 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: rf_dagutils.h,v 1.15 2004/03/20 16:48:05 oster Exp $   */
+/*     $NetBSD: rf_dagutils.h,v 1.16 2004/03/23 21:53:36 oster Exp $   */
 /*
  * Copyright (c) 1995 Carnegie-Mellon University.
  * All rights reserved.
@@ -81,7 +81,8 @@
 RF_FuncList_t *rf_AllocFuncList(void);
 void rf_FreeFuncList(RF_FuncList_t *);
 
-void *rf_AllocBuffer(RF_Raid_t *, RF_DagHeader_t *, int);
+void *rf_AllocBuffer(RF_Raid_t *, int, RF_AllocListElem_t *);
+void *rf_AllocBuffer2(RF_Raid_t *, RF_DagHeader_t *, int);
 void *rf_AllocIOBuffer(RF_Raid_t *, int);
 void rf_FreeIOBuffer(RF_Raid_t *, void *);
 



Home | Main Index | Thread Index | Old Index