Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/raidframe [Having received a definite lack of strenu...



details:   https://anonhg.NetBSD.org/src/rev/f451db7c0003
branches:  trunk
changeset: 556848:f451db7c0003
user:      oster <oster%NetBSD.org@localhost>
date:      Mon Dec 29 02:38:17 2003 +0000

description:
[Having received a definite lack of strenuous objection, a small amount
of strenuous agreement, and some general agreement, this commit is
going ahead because it's now starting to block some other changes I
wish to make.]

Remove most of the support for the concept of "rows" from RAIDframe.
While the "row" interface has been exported to the world, RAIDframe
internals have really only supported a single row, even though they
have feigned support of multiple rows.

Nothing changes in configuration land -- config files still need to
specify a single row, etc.  All auto-config structures remain fully
forward/backwards compatible.

The only visible difference to the average user should be a
reduction in the size of a GENERIC kernel (i386) by 4.5K.  For those
of us trolling through RAIDframe kernel code, a lot of the driver
configuration code has become a LOT easier to read.

diffstat:

 sys/dev/raidframe/raidframevar.h          |   11 +-
 sys/dev/raidframe/rf_chaindecluster.c     |   17 +-
 sys/dev/raidframe/rf_chaindecluster.h     |    8 +-
 sys/dev/raidframe/rf_copyback.c           |  111 ++---
 sys/dev/raidframe/rf_dagdegrd.c           |   35 +-
 sys/dev/raidframe/rf_dagdegwr.c           |   14 +-
 sys/dev/raidframe/rf_dagfuncs.c           |   20 +-
 sys/dev/raidframe/rf_dagutils.c           |   78 +--
 sys/dev/raidframe/rf_declusterPQ.c        |   28 +-
 sys/dev/raidframe/rf_desc.h               |    5 +-
 sys/dev/raidframe/rf_diskqueue.c          |   86 +--
 sys/dev/raidframe/rf_diskqueue.h          |    4 +-
 sys/dev/raidframe/rf_disks.c              |  600 +++++++++++++----------------
 sys/dev/raidframe/rf_disks.h              |    4 +-
 sys/dev/raidframe/rf_driver.c             |   85 +--
 sys/dev/raidframe/rf_driver.h             |    5 +-
 sys/dev/raidframe/rf_evenodd.h            |    6 +-
 sys/dev/raidframe/rf_evenodd_dagfuncs.c   |   12 +-
 sys/dev/raidframe/rf_layout.h             |    6 +-
 sys/dev/raidframe/rf_map.c                |   78 +--
 sys/dev/raidframe/rf_map.h                |    4 +-
 sys/dev/raidframe/rf_netbsdkintf.c        |  418 +++++++++-----------
 sys/dev/raidframe/rf_paritylogDiskMgr.c   |   12 +-
 sys/dev/raidframe/rf_paritylogging.c      |   41 +-
 sys/dev/raidframe/rf_paritylogging.h      |   12 +-
 sys/dev/raidframe/rf_parityscan.c         |   30 +-
 sys/dev/raidframe/rf_psstatus.c           |   16 +-
 sys/dev/raidframe/rf_psstatus.h           |   14 +-
 sys/dev/raidframe/rf_raid.h               |   16 +-
 sys/dev/raidframe/rf_raid0.c              |   13 +-
 sys/dev/raidframe/rf_raid0.h              |    8 +-
 sys/dev/raidframe/rf_raid1.c              |   48 +-
 sys/dev/raidframe/rf_raid1.h              |    8 +-
 sys/dev/raidframe/rf_raid4.c              |   14 +-
 sys/dev/raidframe/rf_raid4.h              |    8 +-
 sys/dev/raidframe/rf_raid5.c              |   40 +-
 sys/dev/raidframe/rf_raid5.h              |    8 +-
 sys/dev/raidframe/rf_raid5_rotatedspare.c |   13 +-
 sys/dev/raidframe/rf_raid5_rotatedspare.h |    8 +-
 sys/dev/raidframe/rf_reconbuffer.c        |   33 +-
 sys/dev/raidframe/rf_reconbuffer.h        |    5 +-
 sys/dev/raidframe/rf_reconmap.c           |    7 +-
 sys/dev/raidframe/rf_reconmap.h           |    4 +-
 sys/dev/raidframe/rf_reconstruct.c        |  436 +++++++++-----------
 sys/dev/raidframe/rf_reconstruct.h        |   13 +-
 sys/dev/raidframe/rf_reconutil.c          |   47 +-
 sys/dev/raidframe/rf_reconutil.h          |    9 +-
 sys/dev/raidframe/rf_revent.c             |   25 +-
 sys/dev/raidframe/rf_revent.h             |    5 +-
 sys/dev/raidframe/rf_states.c             |    6 +-
 50 files changed, 1111 insertions(+), 1423 deletions(-)

diffs (truncated from 6528 to 300 lines):

diff -r aed7ca602333 -r f451db7c0003 sys/dev/raidframe/raidframevar.h
--- a/sys/dev/raidframe/raidframevar.h  Mon Dec 29 02:11:03 2003 +0000
+++ b/sys/dev/raidframe/raidframevar.h  Mon Dec 29 02:38:17 2003 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: raidframevar.h,v 1.4 2003/08/12 10:01:08 dsl Exp $ */
+/*     $NetBSD: raidframevar.h,v 1.5 2003/12/29 02:38:17 oster Exp $ */
 /*-
  * Copyright (c) 1996, 1997, 1998 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -509,24 +509,23 @@
 
        /* routine to map RAID sector address -> physical (row, col, offset) */
        void    (*MapSector) (RF_Raid_t * raidPtr, RF_RaidAddr_t raidSector,
-                             RF_RowCol_t * row, RF_RowCol_t * col, 
+                             RF_RowCol_t * col, 
                              RF_SectorNum_t * diskSector, int remap);
 
        /* routine to map RAID sector address -> physical (r,c,o) of parity
         * unit */
        void    (*MapParity) (RF_Raid_t * raidPtr, RF_RaidAddr_t raidSector,
-                             RF_RowCol_t * row, RF_RowCol_t * col, 
+                             RF_RowCol_t * col, 
                              RF_SectorNum_t * diskSector, int remap);
 
        /* routine to map RAID sector address -> physical (r,c,o) of Q unit */
        void    (*MapQ) (RF_Raid_t * raidPtr, RF_RaidAddr_t raidSector, 
-                        RF_RowCol_t * row, RF_RowCol_t * col, 
+                        RF_RowCol_t * col, 
                         RF_SectorNum_t * diskSector, int remap);
 
        /* routine to identify the disks comprising a stripe */
        void    (*IdentifyStripe) (RF_Raid_t * raidPtr, RF_RaidAddr_t addr,
-                                  RF_RowCol_t ** diskids, 
-                                  RF_RowCol_t * outRow);
+                                  RF_RowCol_t ** diskids);
 
        /* routine to select a dag */
        void    (*SelectionFunc) (RF_Raid_t * raidPtr, RF_IoType_t type,
diff -r aed7ca602333 -r f451db7c0003 sys/dev/raidframe/rf_chaindecluster.c
--- a/sys/dev/raidframe/rf_chaindecluster.c     Mon Dec 29 02:11:03 2003 +0000
+++ b/sys/dev/raidframe/rf_chaindecluster.c     Mon Dec 29 02:38:17 2003 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: rf_chaindecluster.c,v 1.9 2002/09/23 02:40:08 oster Exp $      */
+/*     $NetBSD: rf_chaindecluster.c,v 1.10 2003/12/29 02:38:17 oster Exp $     */
 /*
  * Copyright (c) 1995 Carnegie-Mellon University.
  * All rights reserved.
@@ -33,7 +33,7 @@
  *****************************************************************************/
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: rf_chaindecluster.c,v 1.9 2002/09/23 02:40:08 oster Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rf_chaindecluster.c,v 1.10 2003/12/29 02:38:17 oster Exp $");
 
 #include "rf_archs.h"
 
@@ -86,8 +86,6 @@
                info->stripeIdentifier[i][1] = (i + 1) % raidPtr->numCol;
        }
 
-       RF_ASSERT(raidPtr->numRow == 1);
-
        /* fill in the remaining layout parameters */
        num_used_stripeUnitsPerDisk = layoutPtr->stripeUnitsPerDisk - (layoutPtr->stripeUnitsPerDisk %
            (2 * raidPtr->numCol - 2));
@@ -131,7 +129,6 @@
 rf_MapSectorChainDecluster(
     RF_Raid_t * raidPtr,
     RF_RaidAddr_t raidSector,
-    RF_RowCol_t * row,
     RF_RowCol_t * col,
     RF_SectorNum_t * diskSector,
     int remap)
@@ -142,7 +139,6 @@
        RF_StripeNum_t sparing_region_id;
        int     col_before_remap;
 
-       *row = 0;
        sparing_region_id = SUID / info->stripeUnitsPerSparingRegion;
        index_within_region = SUID % info->stripeUnitsPerSparingRegion;
        index_within_disk = index_within_region / raidPtr->numCol;
@@ -180,7 +176,6 @@
 rf_MapParityChainDecluster(
     RF_Raid_t * raidPtr,
     RF_RaidAddr_t raidSector,
-    RF_RowCol_t * row,
     RF_RowCol_t * col,
     RF_SectorNum_t * diskSector,
     int remap)
@@ -191,7 +186,6 @@
        RF_StripeNum_t sparing_region_id;
        int     col_before_remap;
 
-       *row = 0;
        if (!remap) {
                *col = SUID % raidPtr->numCol;
                *col = (*col + 1) % raidPtr->numCol;
@@ -223,8 +217,7 @@
 rf_IdentifyStripeChainDecluster(
     RF_Raid_t * raidPtr,
     RF_RaidAddr_t addr,
-    RF_RowCol_t ** diskids,
-    RF_RowCol_t * outRow)
+    RF_RowCol_t ** diskids)
 {
        RF_ChaindeclusterConfigInfo_t *info = (RF_ChaindeclusterConfigInfo_t *) raidPtr->Layout.layoutSpecificInfo;
        RF_StripeNum_t SUID;
@@ -232,7 +225,6 @@
 
        SUID = addr / raidPtr->Layout.sectorsPerStripeUnit;
        col = SUID % raidPtr->numCol;
-       *outRow = 0;
        *diskids = info->stripeIdentifier[col];
 }
 
@@ -268,7 +260,6 @@
 #endif
 {
        RF_ASSERT(RF_IO_IS_R_OR_W(type));
-       RF_ASSERT(raidPtr->numRow == 1);
 
        if (asmap->numDataFailed + asmap->numParityFailed > 1) {
                RF_ERRORMSG("Multiple disks failed in a single group!  Aborting I/O operation.\n");
@@ -278,7 +269,7 @@
        *createFunc = (type == RF_IO_TYPE_READ) ? (RF_VoidFuncPtr) rf_CreateFaultFreeReadDAG : (RF_VoidFuncPtr) rf_CreateRaidOneWriteDAG;
 
        if (type == RF_IO_TYPE_READ) {
-               if ((raidPtr->status[0] == rf_rs_degraded) || (raidPtr->status[0] == rf_rs_reconstructing))
+               if ((raidPtr->status == rf_rs_degraded) || (raidPtr->status == rf_rs_reconstructing))
                        *createFunc = (RF_VoidFuncPtr) rf_CreateRaidCDegradedReadDAG;   /* array status is
                                                                                         * degraded, implement
                                                                                         * workload shifting */
diff -r aed7ca602333 -r f451db7c0003 sys/dev/raidframe/rf_chaindecluster.h
--- a/sys/dev/raidframe/rf_chaindecluster.h     Mon Dec 29 02:11:03 2003 +0000
+++ b/sys/dev/raidframe/rf_chaindecluster.h     Mon Dec 29 02:38:17 2003 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: rf_chaindecluster.h,v 1.4 2001/01/26 04:14:14 oster Exp $      */
+/*     $NetBSD: rf_chaindecluster.h,v 1.5 2003/12/29 02:38:17 oster Exp $      */
 /*
  * Copyright (c) 1995 Carnegie-Mellon University.
  * All rights reserved.
@@ -40,13 +40,13 @@
 RF_ReconUnitCount_t rf_GetNumSpareRUsChainDecluster(RF_Raid_t * raidPtr);
 void 
 rf_MapSectorChainDecluster(RF_Raid_t * raidPtr, RF_RaidAddr_t raidSector,
-    RF_RowCol_t * row, RF_RowCol_t * col, RF_SectorNum_t * diskSector, int remap);
+    RF_RowCol_t * col, RF_SectorNum_t * diskSector, int remap);
 void 
 rf_MapParityChainDecluster(RF_Raid_t * raidPtr, RF_RaidAddr_t raidSector,
-    RF_RowCol_t * row, RF_RowCol_t * col, RF_SectorNum_t * diskSector, int remap);
+    RF_RowCol_t * col, RF_SectorNum_t * diskSector, int remap);
 void 
 rf_IdentifyStripeChainDecluster(RF_Raid_t * raidPtr, RF_RaidAddr_t addr,
-    RF_RowCol_t ** diskids, RF_RowCol_t * outRow);
+    RF_RowCol_t ** diskids);
 void 
 rf_MapSIDToPSIDChainDecluster(RF_RaidLayout_t * layoutPtr,
     RF_StripeNum_t stripeID, RF_StripeNum_t * psID,
diff -r aed7ca602333 -r f451db7c0003 sys/dev/raidframe/rf_copyback.c
--- a/sys/dev/raidframe/rf_copyback.c   Mon Dec 29 02:11:03 2003 +0000
+++ b/sys/dev/raidframe/rf_copyback.c   Mon Dec 29 02:38:17 2003 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: rf_copyback.c,v 1.25 2003/06/29 22:30:32 fvdl Exp $    */
+/*     $NetBSD: rf_copyback.c,v 1.26 2003/12/29 02:38:17 oster Exp $   */
 /*
  * Copyright (c) 1995 Carnegie-Mellon University.
  * All rights reserved.
@@ -38,7 +38,7 @@
  ****************************************************************************************/
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: rf_copyback.c,v 1.25 2003/06/29 22:30:32 fvdl Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rf_copyback.c,v 1.26 2003/12/29 02:38:17 oster Exp $");
 
 #include <dev/raidframe/raidframevar.h>
 
@@ -64,8 +64,7 @@
 static int rf_CopybackReadDoneProc(RF_CopybackDesc_t * desc, int status);
 static int rf_CopybackWriteDoneProc(RF_CopybackDesc_t * desc, int status);
 static void rf_CopybackOne(RF_CopybackDesc_t * desc, int typ,
-                          RF_RaidAddr_t addr, RF_RowCol_t testRow, 
-                          RF_RowCol_t testCol,
+                          RF_RaidAddr_t addr, RF_RowCol_t testCol,
                           RF_SectorNum_t testOffs);
 static void rf_CopybackComplete(RF_CopybackDesc_t * desc, int status);
 
@@ -90,9 +89,9 @@
        RF_Raid_t *raidPtr;
 {
        RF_ComponentLabel_t c_label;
-       int     done, retcode;
+       int     found, retcode;
        RF_CopybackDesc_t *desc;
-       RF_RowCol_t frow, fcol;
+       RF_RowCol_t fcol;
        RF_RaidDisk_t *badDisk;
        char   *databuf;
 
@@ -103,51 +102,48 @@
 
        int ac;
 
-       done = 0;
        fcol = 0;
-       for (frow = 0; frow < raidPtr->numRow; frow++) {
-               for (fcol = 0; fcol < raidPtr->numCol; fcol++) {
-                       if (raidPtr->Disks[frow][fcol].status == rf_ds_dist_spared
-                           || raidPtr->Disks[frow][fcol].status == rf_ds_spared) {
-                               done = 1;
-                               break;
-                       }
+       found = 0;
+       for (fcol = 0; fcol < raidPtr->numCol; fcol++) {
+               if (raidPtr->Disks[fcol].status == rf_ds_dist_spared
+                   || raidPtr->Disks[fcol].status == rf_ds_spared) {
+                       found = 1;
+                       break;
                }
-               if (done)
-                       break;
        }
 
-       if (frow == raidPtr->numRow) {
+       if (!found) {
                printf("raid%d: no disks need copyback\n", raidPtr->raidid);
                return;
        }
-       badDisk = &raidPtr->Disks[frow][fcol];
+
+       badDisk = &raidPtr->Disks[fcol];
 
        proc = raidPtr->engine_thread;
 
        /* This device may have been opened successfully the first time. Close
         * it before trying to open it again.. */
 
-       if (raidPtr->raid_cinfo[frow][fcol].ci_vp != NULL) {
+       if (raidPtr->raid_cinfo[fcol].ci_vp != NULL) {
                printf("Closed the open device: %s\n",
-                   raidPtr->Disks[frow][fcol].devname);
-               vp = raidPtr->raid_cinfo[frow][fcol].ci_vp;
-               ac = raidPtr->Disks[frow][fcol].auto_configured;
+                   raidPtr->Disks[fcol].devname);
+               vp = raidPtr->raid_cinfo[fcol].ci_vp;
+               ac = raidPtr->Disks[fcol].auto_configured;
                rf_close_component(raidPtr, vp, ac);
-               raidPtr->raid_cinfo[frow][fcol].ci_vp = NULL;
+               raidPtr->raid_cinfo[fcol].ci_vp = NULL;
 
        }
        /* note that this disk was *not* auto_configured (any longer) */
-       raidPtr->Disks[frow][fcol].auto_configured = 0;
+       raidPtr->Disks[fcol].auto_configured = 0;
 
        printf("About to (re-)open the device: %s\n",
-           raidPtr->Disks[frow][fcol].devname);
+           raidPtr->Disks[fcol].devname);
 
-       retcode = raidlookup(raidPtr->Disks[frow][fcol].devname, proc, &vp);
+       retcode = raidlookup(raidPtr->Disks[fcol].devname, proc, &vp);
 
        if (retcode) {
                printf("raid%d: copyback: raidlookup on device: %s failed: %d!\n",
-                      raidPtr->raidid, raidPtr->Disks[frow][fcol].devname, 
+                      raidPtr->raidid, raidPtr->Disks[fcol].devname, 
                       retcode);
 
                /* XXX the component isn't responding properly... must be
@@ -167,21 +163,21 @@
                if (retcode) {
                        return;
                }
-               raidPtr->Disks[frow][fcol].blockSize = dpart.disklab->d_secsize;
+               raidPtr->Disks[fcol].blockSize = dpart.disklab->d_secsize;
 
-               raidPtr->Disks[frow][fcol].numBlocks = dpart.part->p_size -
+               raidPtr->Disks[fcol].numBlocks = dpart.part->p_size -
                    rf_protectedSectors;
 
-               raidPtr->raid_cinfo[frow][fcol].ci_vp = vp;
-               raidPtr->raid_cinfo[frow][fcol].ci_dev = va.va_rdev;
+               raidPtr->raid_cinfo[fcol].ci_vp = vp;
+               raidPtr->raid_cinfo[fcol].ci_dev = va.va_rdev;
 
-               raidPtr->Disks[frow][fcol].dev = va.va_rdev;    /* XXX or the above? */
+               raidPtr->Disks[fcol].dev = va.va_rdev;  /* XXX or the above? */
 
                /* we allow the user to specify that only a fraction of the
                 * disks should be used this is just for debug:  it speeds up
                 * the parity scan */
-               raidPtr->Disks[frow][fcol].numBlocks =
-                   raidPtr->Disks[frow][fcol].numBlocks *
+               raidPtr->Disks[fcol].numBlocks =
+                   raidPtr->Disks[fcol].numBlocks *
                    rf_sizePercentage / 100;
        }
 
@@ -197,9 +193,7 @@
        RF_Malloc(desc, sizeof(*desc), (RF_CopybackDesc_t *));
        desc->raidPtr = raidPtr;



Home | Main Index | Thread Index | Old Index