Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/raidframe constify some



details:   https://anonhg.NetBSD.org/src/rev/6efbba2abf9d
branches:  trunk
changeset: 542836:6efbba2abf9d
user:      jdolecek <jdolecek%NetBSD.org@localhost>
date:      Sun Feb 09 10:04:32 2003 +0000

description:
constify some

diffstat:

 sys/dev/raidframe/rf_dagdegrd.c    |   6 +++---
 sys/dev/raidframe/rf_dagdegrd.h    |   4 ++--
 sys/dev/raidframe/rf_dagffwr.c     |   8 ++++----
 sys/dev/raidframe/rf_dagffwr.h     |   6 +++---
 sys/dev/raidframe/rf_dagutils.c    |   8 ++++----
 sys/dev/raidframe/rf_dagutils.h    |   6 +++---
 sys/dev/raidframe/rf_diskqueue.c   |  10 +++++-----
 sys/dev/raidframe/rf_diskqueue.h   |   6 +++---
 sys/dev/raidframe/rf_layout.c      |  15 ++++++++-------
 sys/dev/raidframe/rf_layout.h      |   8 ++++----
 sys/dev/raidframe/rf_parityscan.c  |   6 +++---
 sys/dev/raidframe/rf_raid.h        |   4 ++--
 sys/dev/raidframe/rf_reconbuffer.c |   8 ++++----
 sys/dev/raidframe/rf_reconstruct.c |   8 ++++----
 sys/dev/raidframe/rf_reconutil.c   |  10 +++++-----
 15 files changed, 57 insertions(+), 56 deletions(-)

diffs (truncated from 471 to 300 lines):

diff -r 18be8106b17b -r 6efbba2abf9d sys/dev/raidframe/rf_dagdegrd.c
--- a/sys/dev/raidframe/rf_dagdegrd.c   Sun Feb 09 09:56:49 2003 +0000
+++ b/sys/dev/raidframe/rf_dagdegrd.c   Sun Feb 09 10:04:32 2003 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: rf_dagdegrd.c,v 1.12 2002/08/02 03:42:33 oster Exp $   */
+/*     $NetBSD: rf_dagdegrd.c,v 1.13 2003/02/09 10:04:32 jdolecek Exp $        */
 /*
  * Copyright (c) 1995 Carnegie-Mellon University.
  * All rights reserved.
@@ -33,7 +33,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: rf_dagdegrd.c,v 1.12 2002/08/02 03:42:33 oster Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rf_dagdegrd.c,v 1.13 2003/02/09 10:04:32 jdolecek Exp $");
 
 #include <dev/raidframe/raidframevar.h>
 
@@ -257,7 +257,7 @@
     void *bp,
     RF_RaidAccessFlags_t flags,
     RF_AllocListElem_t * allocList,
-    RF_RedFuncs_t * recFunc)
+    const RF_RedFuncs_t * recFunc)
 {
        RF_DagNode_t *nodes, *rudNodes, *rrdNodes, *xorNode, *blockNode;
        RF_DagNode_t *commitNode, *rpNode, *termNode;
diff -r 18be8106b17b -r 6efbba2abf9d sys/dev/raidframe/rf_dagdegrd.h
--- a/sys/dev/raidframe/rf_dagdegrd.h   Sun Feb 09 09:56:49 2003 +0000
+++ b/sys/dev/raidframe/rf_dagdegrd.h   Sun Feb 09 10:04:32 2003 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: rf_dagdegrd.h,v 1.4 2001/10/04 15:58:52 oster Exp $    */
+/*     $NetBSD: rf_dagdegrd.h,v 1.5 2003/02/09 10:04:33 jdolecek Exp $ */
 /*
  * Copyright (c) 1995 Carnegie-Mellon University.
  * All rights reserved.
@@ -44,7 +44,7 @@
 rf_CreateDegradedReadDAG(RF_Raid_t * raidPtr,
     RF_AccessStripeMap_t * asmap, RF_DagHeader_t * dag_h, void *bp,
     RF_RaidAccessFlags_t flags, RF_AllocListElem_t * allocList,
-    RF_RedFuncs_t * recFunc);
+    const RF_RedFuncs_t * recFunc);
 void 
 rf_CreateRaidCDegradedReadDAG(RF_Raid_t * raidPtr,
     RF_AccessStripeMap_t * asmap, RF_DagHeader_t * dag_h, void *bp,
diff -r 18be8106b17b -r 6efbba2abf9d sys/dev/raidframe/rf_dagffwr.c
--- a/sys/dev/raidframe/rf_dagffwr.c    Sun Feb 09 09:56:49 2003 +0000
+++ b/sys/dev/raidframe/rf_dagffwr.c    Sun Feb 09 10:04:32 2003 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: rf_dagffwr.c,v 1.9 2002/09/21 00:50:10 oster Exp $     */
+/*     $NetBSD: rf_dagffwr.c,v 1.10 2003/02/09 10:04:33 jdolecek 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.9 2002/09/21 00:50:10 oster Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rf_dagffwr.c,v 1.10 2003/02/09 10:04:33 jdolecek Exp $");
 
 #include <dev/raidframe/raidframevar.h>
 
@@ -471,8 +471,8 @@
     void *bp,
     RF_RaidAccessFlags_t flags,
     RF_AllocListElem_t * allocList,
-    RF_RedFuncs_t * pfuncs,
-    RF_RedFuncs_t * qfuncs)
+    const RF_RedFuncs_t * pfuncs,
+    const RF_RedFuncs_t * qfuncs)
 {
        RF_DagNode_t *readDataNodes, *readParityNodes, *readQNodes, *termNode;
        RF_DagNode_t *unlockDataNodes, *unlockParityNodes, *unlockQNodes;
diff -r 18be8106b17b -r 6efbba2abf9d sys/dev/raidframe/rf_dagffwr.h
--- a/sys/dev/raidframe/rf_dagffwr.h    Sun Feb 09 09:56:49 2003 +0000
+++ b/sys/dev/raidframe/rf_dagffwr.h    Sun Feb 09 10:04:32 2003 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: rf_dagffwr.h,v 1.4 2001/10/04 15:58:52 oster Exp $     */
+/*     $NetBSD: rf_dagffwr.h,v 1.5 2003/02/09 10:04:33 jdolecek Exp $  */
 /*
  * Copyright (c) 1995 Carnegie-Mellon University.
  * All rights reserved.
@@ -61,11 +61,11 @@
        void    rf_CommonCreateSmallWriteDAG(RF_Raid_t * raidPtr,
             RF_AccessStripeMap_t * asmap, RF_DagHeader_t * dag_h, void *bp,
             RF_RaidAccessFlags_t flags, RF_AllocListElem_t * allocList,
-            RF_RedFuncs_t * pfuncs, RF_RedFuncs_t * qfuncs);
+            const RF_RedFuncs_t * pfuncs, const RF_RedFuncs_t * qfuncs);
        void    rf_CommonCreateSmallWriteDAGFwd(RF_Raid_t * raidPtr,
             RF_AccessStripeMap_t * asmap, RF_DagHeader_t * dag_h, void *bp,
             RF_RaidAccessFlags_t flags, RF_AllocListElem_t * allocList,
-            RF_RedFuncs_t * pfuncs, RF_RedFuncs_t * qfuncs);
+            const RF_RedFuncs_t * pfuncs, const RF_RedFuncs_t * qfuncs);
        void    rf_CreateRaidOneWriteDAG(RF_Raid_t * raidPtr, RF_AccessStripeMap_t * asmap,
             RF_DagHeader_t * dag_h, void *bp, RF_RaidAccessFlags_t flags,
             RF_AllocListElem_t * allocList);
diff -r 18be8106b17b -r 6efbba2abf9d sys/dev/raidframe/rf_dagutils.c
--- a/sys/dev/raidframe/rf_dagutils.c   Sun Feb 09 09:56:49 2003 +0000
+++ b/sys/dev/raidframe/rf_dagutils.c   Sun Feb 09 10:04:32 2003 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: rf_dagutils.c,v 1.19 2002/11/22 20:56:10 oster Exp $   */
+/*     $NetBSD: rf_dagutils.c,v 1.20 2003/02/09 10:04:33 jdolecek 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.19 2002/11/22 20:56:10 oster Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rf_dagutils.c,v 1.20 2003/02/09 10:04:33 jdolecek Exp $");
 
 #include <dev/raidframe/raidframevar.h>
 
@@ -50,11 +50,11 @@
 
 #define SNUM_DIFF(_a_,_b_) (((_a_)>(_b_))?((_a_)-(_b_)):((_b_)-(_a_)))
 
-RF_RedFuncs_t rf_xorFuncs = {
+const RF_RedFuncs_t rf_xorFuncs = {
        rf_RegularXorFunc, "Reg Xr",
 rf_SimpleXorFunc, "Simple Xr"};
 
-RF_RedFuncs_t rf_xorRecoveryFuncs = {
+const RF_RedFuncs_t rf_xorRecoveryFuncs = {
        rf_RecoveryXorFunc, "Recovery Xr",
 rf_RecoveryXorFunc, "Recovery Xr"};
 
diff -r 18be8106b17b -r 6efbba2abf9d sys/dev/raidframe/rf_dagutils.h
--- a/sys/dev/raidframe/rf_dagutils.h   Sun Feb 09 09:56:49 2003 +0000
+++ b/sys/dev/raidframe/rf_dagutils.h   Sun Feb 09 10:04:32 2003 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: rf_dagutils.h,v 1.6 2002/09/21 14:47:07 oster Exp $    */
+/*     $NetBSD: rf_dagutils.h,v 1.7 2003/02/09 10:04:33 jdolecek Exp $ */
 /*
  * Copyright (c) 1995 Carnegie-Mellon University.
  * All rights reserved.
@@ -48,8 +48,8 @@
        char   *SimpleName;
 };
 
-extern RF_RedFuncs_t rf_xorFuncs;
-extern RF_RedFuncs_t rf_xorRecoveryFuncs;
+extern const RF_RedFuncs_t rf_xorFuncs;
+extern const RF_RedFuncs_t rf_xorRecoveryFuncs;
 
 void 
 rf_InitNode(RF_DagNode_t * node, RF_NodeStatus_t initstatus,
diff -r 18be8106b17b -r 6efbba2abf9d sys/dev/raidframe/rf_diskqueue.c
--- a/sys/dev/raidframe/rf_diskqueue.c  Sun Feb 09 09:56:49 2003 +0000
+++ b/sys/dev/raidframe/rf_diskqueue.c  Sun Feb 09 10:04:32 2003 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: rf_diskqueue.c,v 1.21 2002/09/17 02:55:12 oster Exp $  */
+/*     $NetBSD: rf_diskqueue.c,v 1.22 2003/02/09 10:04:33 jdolecek Exp $       */
 /*
  * Copyright (c) 1995 Carnegie-Mellon University.
  * All rights reserved.
@@ -66,7 +66,7 @@
  ****************************************************************************/
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: rf_diskqueue.c,v 1.21 2002/09/17 02:55:12 oster Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rf_diskqueue.c,v 1.22 2003/02/09 10:04:33 jdolecek Exp $");
 
 #include <dev/raidframe/raidframevar.h>
 
@@ -111,7 +111,7 @@
  *
  ****************************************************************************/
 
-static RF_DiskQueueSW_t diskqueuesw[] = {
+static const RF_DiskQueueSW_t diskqueuesw[] = {
        {"fifo",                /* FIFO */
                rf_FifoCreate,
                rf_FifoEnqueue,
@@ -188,7 +188,7 @@
       RF_RowCol_t r,           /* row & col -- debug only.  BZZT not any
                                 * more... */
       RF_RowCol_t c,
-      RF_DiskQueueSW_t * p,
+      const RF_DiskQueueSW_t * p,
       RF_SectorCount_t sectPerDisk,
       dev_t dev,
       int maxOutstanding,
@@ -259,7 +259,7 @@
     RF_Config_t * cfgPtr)
 {
        RF_DiskQueue_t **diskQueues, *spareQueues;
-       RF_DiskQueueSW_t *p;
+       const RF_DiskQueueSW_t *p;
        RF_RowCol_t r, c;
        int     rc, i;
 
diff -r 18be8106b17b -r 6efbba2abf9d sys/dev/raidframe/rf_diskqueue.h
--- a/sys/dev/raidframe/rf_diskqueue.h  Sun Feb 09 09:56:49 2003 +0000
+++ b/sys/dev/raidframe/rf_diskqueue.h  Sun Feb 09 10:04:32 2003 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: rf_diskqueue.h,v 1.11 2002/10/04 20:05:14 oster Exp $  */
+/*     $NetBSD: rf_diskqueue.h,v 1.12 2003/02/09 10:04:33 jdolecek Exp $       */
 /*
  * Copyright (c) 1995 Carnegie-Mellon University.
  * All rights reserved.
@@ -102,7 +102,7 @@
 };
 
 struct RF_DiskQueue_s {
-       RF_DiskQueueSW_t *qPtr; /* access point to queue functions */
+       const RF_DiskQueueSW_t *qPtr;   /* access point to queue functions */
        void   *qHdr;           /* queue header, of whatever type */
                RF_DECLARE_MUTEX(mutex) /* mutex locking data structures */
                RF_DECLARE_COND(cond)   /* condition variable for
@@ -183,7 +183,7 @@
 
 int 
 rf_ConfigureDiskQueue(RF_Raid_t *, RF_DiskQueue_t *, RF_RowCol_t, 
-                     RF_RowCol_t, RF_DiskQueueSW_t *,
+                     RF_RowCol_t, const RF_DiskQueueSW_t *,
                      RF_SectorCount_t, dev_t, int, 
                      RF_ShutdownList_t **,
                      RF_AllocListElem_t *);
diff -r 18be8106b17b -r 6efbba2abf9d sys/dev/raidframe/rf_layout.c
--- a/sys/dev/raidframe/rf_layout.c     Sun Feb 09 09:56:49 2003 +0000
+++ b/sys/dev/raidframe/rf_layout.c     Sun Feb 09 10:04:32 2003 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: rf_layout.c,v 1.13 2002/09/23 02:35:24 oster Exp $     */
+/*     $NetBSD: rf_layout.c,v 1.14 2003/02/09 10:04:33 jdolecek Exp $  */
 /*
  * Copyright (c) 1995 Carnegie-Mellon University.
  * All rights reserved.
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: rf_layout.c,v 1.13 2002/09/23 02:35:24 oster Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rf_layout.c,v 1.14 2003/02/09 10:04:33 jdolecek Exp $");
 
 #include <dev/raidframe/raidframevar.h>
 
@@ -77,7 +77,8 @@
  *
  ***********************************************************************/
 
-static RF_AccessState_t DefaultStates[] = {rf_QuiesceState,
+static const RF_AccessState_t DefaultStates[] = {
+                                          rf_QuiesceState,
                                           rf_IncrAccessesCountState, 
                                           rf_MapState, 
                                           rf_LockState, 
@@ -93,7 +94,7 @@
 /* Note that if you add any new RAID types to this list, that you must
    also update the mapsw[] table in the raidctl sources */
 
-static RF_LayoutSW_t mapsw[] = {
+static const RF_LayoutSW_t mapsw[] = {
 #if RF_INCLUDE_PARITY_DECLUSTERING > 0
        /* parity declustering */
        {'T', "Parity declustering",
@@ -373,10 +374,10 @@
        }
 };
 
-RF_LayoutSW_t *
+const RF_LayoutSW_t *
 rf_GetLayout(RF_ParityConfig_t parityConfig)
 {
-       RF_LayoutSW_t *p;
+       const RF_LayoutSW_t *p;
 
        /* look up the specific layout */
        for (p = &mapsw[0]; p->parityConfig; p++)
@@ -405,7 +406,7 @@
 {
        RF_RaidLayout_t *layoutPtr = &(raidPtr->Layout);
        RF_ParityConfig_t parityConfig;
-       RF_LayoutSW_t *p;
+       const RF_LayoutSW_t *p;
        int     retval;
 
        layoutPtr->sectorsPerStripeUnit = cfgPtr->sectPerSU;
diff -r 18be8106b17b -r 6efbba2abf9d sys/dev/raidframe/rf_layout.h
--- a/sys/dev/raidframe/rf_layout.h     Sun Feb 09 09:56:49 2003 +0000
+++ b/sys/dev/raidframe/rf_layout.h     Sun Feb 09 10:04:32 2003 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: rf_layout.h,v 1.9 2002/09/23 02:40:07 oster Exp $      */
+/*     $NetBSD: rf_layout.h,v 1.10 2003/02/09 10:04:33 jdolecek Exp $  */
 /*
  * Copyright (c) 1995 Carnegie-Mellon University.
  * All rights reserved.
@@ -78,8 +78,8 @@
                                                 * now */
        RF_StripeCount_t stripeUnitsPerDisk;
 
-       RF_LayoutSW_t *map;     /* ptr to struct holding mapping fns and
-                                * information */
+       const RF_LayoutSW_t *map;       /* ptr to struct holding mapping fns and
+                                        * information */
        void   *layoutSpecificInfo;     /* ptr to a structure holding
                                         * layout-specific params */
 };



Home | Main Index | Thread Index | Old Index