Source-Changes-HG archive

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

[src/netbsd-3]: src/sys/dev/raidframe Pull up revision 1.26 (requested by ost...



details:   https://anonhg.NetBSD.org/src/rev/6c4b4d26338f
branches:  netbsd-3
changeset: 576266:6c4b4d26338f
user:      tron <tron%NetBSD.org@localhost>
date:      Fri Jun 17 13:36:25 2005 +0000

description:
Pull up revision 1.26 (requested by oster in ticket #472):
- avoid variable shadowing
- add a lot of const
- remove parameters from function declarations

diffstat:

 sys/dev/raidframe/rf_raid1.c |  28 ++++++++++++++--------------
 1 files changed, 14 insertions(+), 14 deletions(-)

diffs (97 lines):

diff -r 46badd0f2adc -r 6c4b4d26338f sys/dev/raidframe/rf_raid1.c
--- a/sys/dev/raidframe/rf_raid1.c      Fri Jun 17 13:36:18 2005 +0000
+++ b/sys/dev/raidframe/rf_raid1.c      Fri Jun 17 13:36:25 2005 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: rf_raid1.c,v 1.25 2005/02/27 00:27:45 perry Exp $      */
+/*     $NetBSD: rf_raid1.c,v 1.25.2.1 2005/06/17 13:36:25 tron Exp $   */
 /*
  * Copyright (c) 1995 Carnegie-Mellon University.
  * All rights reserved.
@@ -33,7 +33,7 @@
  *****************************************************************************/
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: rf_raid1.c,v 1.25 2005/02/27 00:27:45 perry Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rf_raid1.c,v 1.25.2.1 2005/06/17 13:36:25 tron Exp $");
 
 #include "rf_raid.h"
 #include "rf_raid1.h"
@@ -263,7 +263,7 @@
        RF_AccessStripeMap_t *aasm;
        RF_SectorCount_t nsector;
        RF_RaidAddr_t startAddr;
-       char   *buf, *buf1, *buf2;
+       char   *bf, *buf1, *buf2;
        RF_PhysDiskAddr_t *pda;
        RF_StripeNum_t psID;
        RF_MCPair_t *mcpair;
@@ -289,14 +289,14 @@
        RF_ASSERT(layoutPtr->numDataCol == layoutPtr->numParityCol);
        stripeWidth = layoutPtr->numDataCol + layoutPtr->numParityCol;
        bcount = nbytes * (layoutPtr->numDataCol + layoutPtr->numParityCol);
-       RF_MallocAndAdd(buf, bcount, (char *), allocList);
-       if (buf == NULL)
+       RF_MallocAndAdd(bf, bcount, (char *), allocList);
+       if (bf == NULL)
                goto done;
 #if RF_DEBUG_VERIFYPARITY
        if (rf_verifyParityDebug) {
                printf("raid%d: RAID1 parity verify: buf=%lx bcount=%d (%lx - %lx)\n",
-                      raidPtr->raidid, (long) buf, bcount, (long) buf,
-                      (long) buf + bcount);
+                      raidPtr->raidid, (long) bf, bcount, (long) bf,
+                      (long) bf + bcount);
        }
 #endif
        /*
@@ -304,7 +304,7 @@
          * just compare data chunks versus "parity" chunks.
          */
 
-       rd_dag_h = rf_MakeSimpleDAG(raidPtr, stripeWidth, nbytes, buf,
+       rd_dag_h = rf_MakeSimpleDAG(raidPtr, stripeWidth, nbytes, bf,
            rf_DiskReadFunc, rf_DiskReadUndoFunc, "Rod", allocList, flags,
            RF_IO_NORMAL_PRIORITY);
        if (rd_dag_h == NULL)
@@ -317,10 +317,10 @@
          * (which are really mirror copies).
          */
        asm_h = rf_MapAccess(raidPtr, startAddr, layoutPtr->dataSectorsPerStripe,
-           buf, RF_DONT_REMAP);
+           bf, RF_DONT_REMAP);
        aasm = asm_h->stripeMap;
 
-       buf1 = buf;
+       buf1 = bf;
        /*
          * Loop through the data blocks, setting up read nodes for each.
          */
@@ -397,8 +397,8 @@
          * buf1 is the beginning of the data blocks chunk
          * buf2 is the beginning of the parity blocks chunk
          */
-       buf1 = buf;
-       buf2 = buf + (nbytes * layoutPtr->numDataCol);
+       buf1 = bf;
+       buf2 = bf + (nbytes * layoutPtr->numDataCol);
        ret = RF_PARITY_OKAY;
        /*
          * bbufs is "bad bufs"- an array whose entries are the data
@@ -417,7 +417,7 @@
                if (rf_verifyParityDebug) {
                        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);
+                              (long) buf2, (long) bf);
                }
 #endif
                ret = memcmp(buf1, buf2, nbytes);
@@ -466,7 +466,7 @@
                 * copy, and that we're spooging good data by writing bad over it,
                 * but there's no way we can know that.
                 */
-               wr_dag_h = rf_MakeSimpleDAG(raidPtr, nbad, nbytes, buf,
+               wr_dag_h = rf_MakeSimpleDAG(raidPtr, nbad, nbytes, bf,
                    rf_DiskWriteFunc, rf_DiskWriteUndoFunc, "Wnp", allocList, flags,
                    RF_IO_NORMAL_PRIORITY);
                if (wr_dag_h == NULL)



Home | Main Index | Thread Index | Old Index