constify some

This commit is contained in:
jdolecek 2003-02-09 10:04:32 +00:00
parent c9fe87550b
commit e3c5d7b092
15 changed files with 57 additions and 56 deletions

View File

@ -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 @@ rf_CreateDegradedReadDAG(
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;

View File

@ -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 @@ void
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,

View File

@ -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 @@ rf_CommonCreateSmallWriteDAG(
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;

View File

@ -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 @@ rf_CommonCreateLargeWriteDAG(RF_Raid_t * raidPtr,
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);

View File

@ -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 @@ __KERNEL_RCSID(0, "$NetBSD: rf_dagutils.c,v 1.19 2002/11/22 20:56:10 oster Exp $
#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"};

View File

@ -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 @@ struct RF_RedFuncs_s {
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,

View File

@ -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 void rf_ShutdownDiskQueueSystem(void *);
*
****************************************************************************/
static RF_DiskQueueSW_t diskqueuesw[] = {
static const RF_DiskQueueSW_t diskqueuesw[] = {
{"fifo", /* FIFO */
rf_FifoCreate,
rf_FifoEnqueue,
@ -188,7 +188,7 @@ rf_ConfigureDiskQueue(
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_ConfigureDiskQueues(
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;

View File

@ -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_DiskQueueSW_s {
};
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 @@ rf_FreeDiskQueueData(RF_DiskQueueData_t * p);
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 *);

View File

@ -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 @@ __KERNEL_RCSID(0, "$NetBSD: rf_layout.c,v 1.13 2002/09/23 02:35:24 oster Exp $")
*
***********************************************************************/
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 @@ static RF_AccessState_t DefaultStates[] = {rf_QuiesceState,
/* 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 @@ static RF_LayoutSW_t mapsw[] = {
}
};
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_ConfigureLayout(
{
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;

View File

@ -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 @@ struct RF_RaidLayout_s {
* 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 */
};
@ -237,7 +237,7 @@ struct RF_AccessStripeMapHeader_s {
#define rf_ParityStripeIDToRaidAddress(_layoutPtr_, _psid_) \
( (_psid_) * (_layoutPtr_)->SUsPerPU * (_layoutPtr_)->numDataCol * (_layoutPtr_)->sectorsPerStripeUnit )
RF_LayoutSW_t *rf_GetLayout(RF_ParityConfig_t parityConfig);
const RF_LayoutSW_t *rf_GetLayout(RF_ParityConfig_t parityConfig);
int
rf_ConfigureLayout(RF_ShutdownList_t ** listp, RF_Raid_t * raidPtr,
RF_Config_t * cfgPtr);

View File

@ -1,4 +1,4 @@
/* $NetBSD: rf_parityscan.c,v 1.17 2002/09/24 00:53:58 oster Exp $ */
/* $NetBSD: rf_parityscan.c,v 1.18 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_parityscan.c,v 1.17 2002/09/24 00:53:58 oster Exp $");
__KERNEL_RCSID(0, "$NetBSD: rf_parityscan.c,v 1.18 2003/02/09 10:04:33 jdolecek Exp $");
#include <dev/raidframe/raidframevar.h>
@ -144,7 +144,7 @@ rf_VerifyParity(raidPtr, aasm, correct_it, flags)
{
RF_PhysDiskAddr_t *parityPDA;
RF_AccessStripeMap_t *doasm;
RF_LayoutSW_t *lp;
const RF_LayoutSW_t *lp;
int lrc, rc;
lp = raidPtr->Layout.map;

View File

@ -1,4 +1,4 @@
/* $NetBSD: rf_raid.h,v 1.17 2002/10/22 03:15:28 oster Exp $ */
/* $NetBSD: rf_raid.h,v 1.18 2003/02/09 10:04:33 jdolecek Exp $ */
/*
* Copyright (c) 1995 Carnegie-Mellon University.
* All rights reserved.
@ -119,7 +119,7 @@ struct RF_Raid_s {
RF_RaidLayout_t Layout; /* all information related to layout */
RF_RaidDisk_t **Disks; /* all information related to physical disks */
RF_DiskQueue_t **Queues;/* all information related to disk queues */
RF_DiskQueueSW_t *qType;/* pointer to the DiskQueueSW used for the
const RF_DiskQueueSW_t *qType;/* pointer to the DiskQueueSW used for the
component queues. */
/* NOTE: This is an anchor point via which the queues can be
* accessed, but the enqueue/dequeue routines in diskqueue.c use a

View File

@ -1,4 +1,4 @@
/* $NetBSD: rf_reconbuffer.c,v 1.12 2002/11/23 02:38:59 oster Exp $ */
/* $NetBSD: rf_reconbuffer.c,v 1.13 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_reconbuffer.c,v 1.12 2002/11/23 02:38:59 oster Exp $");
__KERNEL_RCSID(0, "$NetBSD: rf_reconbuffer.c,v 1.13 2003/02/09 10:04:33 jdolecek Exp $");
#include "rf_raid.h"
#include "rf_reconbuffer.h"
@ -81,7 +81,7 @@ __KERNEL_RCSID(0, "$NetBSD: rf_reconbuffer.c,v 1.12 2002/11/23 02:38:59 oster Ex
* nWayXorFuncs[i] is a pointer to a function that will xor "i"
* bufs into the accumulating sum.
*/
static RF_VoidFuncPtr nWayXorFuncs[] = {
static const RF_VoidFuncPtr nWayXorFuncs[] = {
NULL,
(RF_VoidFuncPtr) rf_nWayXor1,
(RF_VoidFuncPtr) rf_nWayXor2,
@ -102,7 +102,7 @@ rf_SubmitReconBuffer(rbuf, keep_it, use_committed)
int use_committed; /* whether to use a committed or an available
* recon buffer */
{
RF_LayoutSW_t *lp;
const RF_LayoutSW_t *lp;
int rc;
lp = rbuf->raidPtr->Layout.map;

View File

@ -1,4 +1,4 @@
/* $NetBSD: rf_reconstruct.c,v 1.51 2002/11/19 01:45:29 oster Exp $ */
/* $NetBSD: rf_reconstruct.c,v 1.52 2003/02/09 10:04:34 jdolecek Exp $ */
/*
* Copyright (c) 1995 Carnegie-Mellon University.
* All rights reserved.
@ -33,7 +33,7 @@
************************************************************/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: rf_reconstruct.c,v 1.51 2002/11/19 01:45:29 oster Exp $");
__KERNEL_RCSID(0, "$NetBSD: rf_reconstruct.c,v 1.52 2003/02/09 10:04:34 jdolecek Exp $");
#include <sys/time.h>
#include <sys/buf.h>
@ -260,7 +260,7 @@ rf_ReconstructFailedDisk(raidPtr, row, col)
RF_RowCol_t row;
RF_RowCol_t col;
{
RF_LayoutSW_t *lp;
const RF_LayoutSW_t *lp;
int rc;
lp = raidPtr->Layout.map;
@ -403,7 +403,7 @@ rf_ReconstructInPlace(raidPtr, row, col)
{
RF_RaidDisk_t *spareDiskPtr = NULL;
RF_RaidReconDesc_t *reconDesc;
RF_LayoutSW_t *lp;
const RF_LayoutSW_t *lp;
RF_ComponentLabel_t c_label;
int numDisksDone = 0, rc;
struct partinfo dpart;

View File

@ -1,4 +1,4 @@
/* $NetBSD: rf_reconutil.c,v 1.13 2002/11/23 01:58:18 oster Exp $ */
/* $NetBSD: rf_reconutil.c,v 1.14 2003/02/09 10:04:34 jdolecek Exp $ */
/*
* Copyright (c) 1995 Carnegie-Mellon University.
* All rights reserved.
@ -31,7 +31,7 @@
********************************************/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: rf_reconutil.c,v 1.13 2002/11/23 01:58:18 oster Exp $");
__KERNEL_RCSID(0, "$NetBSD: rf_reconutil.c,v 1.14 2003/02/09 10:04:34 jdolecek Exp $");
#include <dev/raidframe/raidframevar.h>
@ -62,7 +62,7 @@ rf_MakeReconControl(reconDesc, frow, fcol, srow, scol)
RF_ReconUnitCount_t numSpareRUs;
RF_ReconCtrl_t *reconCtrlPtr;
RF_ReconBuffer_t *rbuf;
RF_LayoutSW_t *lp;
const RF_LayoutSW_t *lp;
#if (RF_INCLUDE_PARITY_DECLUSTERING_DS > 0)
int retcode;
#endif
@ -204,7 +204,7 @@ rf_GetDefaultHeadSepLimit(raidPtr)
RF_Raid_t *raidPtr;
{
RF_HeadSepLimit_t hsl;
RF_LayoutSW_t *lp;
const RF_LayoutSW_t *lp;
lp = raidPtr->Layout.map;
if (lp->GetDefaultHeadSepLimit == NULL)
@ -221,7 +221,7 @@ int
rf_GetDefaultNumFloatingReconBuffers(raidPtr)
RF_Raid_t *raidPtr;
{
RF_LayoutSW_t *lp;
const RF_LayoutSW_t *lp;
int nrb;
lp = raidPtr->Layout.map;