Some days you wonder if some of the function declaration consistency
was just an accident in the first place. Cleanup function decls and a few comments. [ok.. so I wasn't going to fix this many.. but once you're on a roll....]
This commit is contained in:
parent
9f96807631
commit
c43fc67d7d
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: rf_acctrace.c,v 1.13 2003/12/30 17:29:41 oster Exp $ */
|
||||
/* $NetBSD: rf_acctrace.c,v 1.14 2003/12/30 21:59:03 oster Exp $ */
|
||||
/*
|
||||
* Copyright (c) 1995 Carnegie-Mellon University.
|
||||
* All rights reserved.
|
||||
@ -34,7 +34,7 @@
|
||||
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: rf_acctrace.c,v 1.13 2003/12/30 17:29:41 oster Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: rf_acctrace.c,v 1.14 2003/12/30 21:59:03 oster Exp $");
|
||||
|
||||
#include <sys/stat.h>
|
||||
#include <sys/types.h>
|
||||
@ -54,8 +54,7 @@ static long numTracesSoFar;
|
||||
RF_DECLARE_MUTEX(rf_tracing_mutex)
|
||||
|
||||
int
|
||||
rf_ConfigureAccessTrace(listp)
|
||||
RF_ShutdownList_t **listp;
|
||||
rf_ConfigureAccessTrace(RF_ShutdownList_t **listp)
|
||||
{
|
||||
|
||||
numTracesSoFar = 0;
|
||||
@ -67,9 +66,7 @@ rf_ConfigureAccessTrace(listp)
|
||||
* if the trace buffer is at least 1/2 full.
|
||||
*/
|
||||
void
|
||||
rf_LogTraceRec(raid, rec)
|
||||
RF_Raid_t *raid;
|
||||
RF_AccTraceEntry_t *rec;
|
||||
rf_LogTraceRec(RF_Raid_t *raid, RF_AccTraceEntry_t *rec)
|
||||
{
|
||||
RF_AccTotals_t *acc = &raid->acc_totals;
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: rf_alloclist.c,v 1.14 2003/07/01 23:53:48 oster Exp $ */
|
||||
/* $NetBSD: rf_alloclist.c,v 1.15 2003/12/30 21:59:03 oster Exp $ */
|
||||
/*
|
||||
* Copyright (c) 1995 Carnegie-Mellon University.
|
||||
* All rights reserved.
|
||||
@ -37,7 +37,7 @@
|
||||
***************************************************************************/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: rf_alloclist.c,v 1.14 2003/07/01 23:53:48 oster Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: rf_alloclist.c,v 1.15 2003/12/30 21:59:03 oster Exp $");
|
||||
|
||||
#include <dev/raidframe/raidframevar.h>
|
||||
|
||||
@ -60,8 +60,7 @@ static int al_free_list_count;
|
||||
|
||||
static void rf_ShutdownAllocList(void *);
|
||||
|
||||
static void rf_ShutdownAllocList(ignored)
|
||||
void *ignored;
|
||||
static void rf_ShutdownAllocList(void *ignored)
|
||||
{
|
||||
RF_AllocListElem_t *p, *pt;
|
||||
|
||||
@ -78,8 +77,7 @@ static void rf_ShutdownAllocList(ignored)
|
||||
}
|
||||
|
||||
int
|
||||
rf_ConfigureAllocList(listp)
|
||||
RF_ShutdownList_t **listp;
|
||||
rf_ConfigureAllocList(RF_ShutdownList_t **listp)
|
||||
{
|
||||
int rc;
|
||||
|
||||
@ -99,10 +97,7 @@ rf_ConfigureAllocList(listp)
|
||||
* increase POINTERS_PER_ALLOC_LIST_ELEMENT.
|
||||
*/
|
||||
void
|
||||
rf_real_AddToAllocList(l, p, size)
|
||||
RF_AllocListElem_t *l;
|
||||
void *p;
|
||||
int size;
|
||||
rf_real_AddToAllocList(RF_AllocListElem_t *l, void *p, int size)
|
||||
{
|
||||
RF_AllocListElem_t *newelem;
|
||||
|
||||
@ -122,8 +117,7 @@ rf_real_AddToAllocList(l, p, size)
|
||||
}
|
||||
|
||||
void
|
||||
rf_FreeAllocList(l)
|
||||
RF_AllocListElem_t *l;
|
||||
rf_FreeAllocList(RF_AllocListElem_t *l)
|
||||
{
|
||||
int i;
|
||||
RF_AllocListElem_t *temp, *p;
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: rf_aselect.c,v 1.9 2003/12/29 03:33:47 oster Exp $ */
|
||||
/* $NetBSD: rf_aselect.c,v 1.10 2003/12/30 21:59:03 oster Exp $ */
|
||||
/*
|
||||
* Copyright (c) 1995 Carnegie-Mellon University.
|
||||
* All rights reserved.
|
||||
@ -33,7 +33,7 @@
|
||||
*****************************************************************************/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: rf_aselect.c,v 1.9 2003/12/29 03:33:47 oster Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: rf_aselect.c,v 1.10 2003/12/30 21:59:03 oster Exp $");
|
||||
|
||||
#include <dev/raidframe/raidframevar.h>
|
||||
|
||||
@ -62,9 +62,7 @@ int rf_SelectAlgorithm(RF_RaidAccessDesc_t *, RF_RaidAccessFlags_t);
|
||||
*
|
||||
*****************************************************************************/
|
||||
static int
|
||||
InitHdrNode(hdr, raidPtr)
|
||||
RF_DagHeader_t **hdr;
|
||||
RF_Raid_t *raidPtr;
|
||||
InitHdrNode(RF_DagHeader_t **hdr, RF_Raid_t *raidPtr)
|
||||
{
|
||||
/* create and initialize dag hdr */
|
||||
*hdr = rf_AllocDAGHeader();
|
||||
@ -115,9 +113,7 @@ InitHdrNode(hdr, raidPtr)
|
||||
#define MAXNSTRIPES 50
|
||||
|
||||
int
|
||||
rf_SelectAlgorithm(desc, flags)
|
||||
RF_RaidAccessDesc_t *desc;
|
||||
RF_RaidAccessFlags_t flags;
|
||||
rf_SelectAlgorithm(RF_RaidAccessDesc_t *desc, RF_RaidAccessFlags_t flags)
|
||||
{
|
||||
RF_AccessStripeMapHeader_t *asm_h = desc->asmap;
|
||||
RF_IoType_t type = desc->type;
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: rf_callback.c,v 1.11 2003/12/29 03:33:47 oster Exp $ */
|
||||
/* $NetBSD: rf_callback.c,v 1.12 2003/12/30 21:59:03 oster Exp $ */
|
||||
/*
|
||||
* Copyright (c) 1995 Carnegie-Mellon University.
|
||||
* All rights reserved.
|
||||
@ -26,15 +26,15 @@
|
||||
* rights to redistribute these changes.
|
||||
*/
|
||||
|
||||
/*****************************************************************************************
|
||||
/*****************************************************************************
|
||||
*
|
||||
* callback.c -- code to manipulate callback descriptor
|
||||
*
|
||||
****************************************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: rf_callback.c,v 1.11 2003/12/29 03:33:47 oster Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: rf_callback.c,v 1.12 2003/12/30 21:59:03 oster Exp $");
|
||||
|
||||
#include <dev/raidframe/raidframevar.h>
|
||||
#include <sys/pool.h>
|
||||
@ -53,8 +53,7 @@ static struct pool rf_callback_pool;
|
||||
|
||||
static void rf_ShutdownCallback(void *);
|
||||
static void
|
||||
rf_ShutdownCallback(ignored)
|
||||
void *ignored;
|
||||
rf_ShutdownCallback(void *ignored)
|
||||
{
|
||||
pool_destroy(&rf_callback_pool);
|
||||
}
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: rf_chaindecluster.c,v 1.10 2003/12/29 02:38:17 oster Exp $ */
|
||||
/* $NetBSD: rf_chaindecluster.c,v 1.11 2003/12/30 21:59:03 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.10 2003/12/29 02:38:17 oster Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: rf_chaindecluster.c,v 1.11 2003/12/30 21:59:03 oster Exp $");
|
||||
|
||||
#include "rf_archs.h"
|
||||
|
||||
@ -61,10 +61,8 @@ typedef struct RF_ChaindeclusterConfigInfo_s {
|
||||
} RF_ChaindeclusterConfigInfo_t;
|
||||
|
||||
int
|
||||
rf_ConfigureChainDecluster(
|
||||
RF_ShutdownList_t ** listp,
|
||||
RF_Raid_t * raidPtr,
|
||||
RF_Config_t * cfgPtr)
|
||||
rf_ConfigureChainDecluster(RF_ShutdownList_t **listp, RF_Raid_t *raidPtr,
|
||||
RF_Config_t *cfgPtr)
|
||||
{
|
||||
RF_RaidLayout_t *layoutPtr = &raidPtr->Layout;
|
||||
RF_StripeCount_t num_used_stripeUnitsPerDisk;
|
||||
@ -111,8 +109,7 @@ rf_ConfigureChainDecluster(
|
||||
}
|
||||
|
||||
RF_ReconUnitCount_t
|
||||
rf_GetNumSpareRUsChainDecluster(raidPtr)
|
||||
RF_Raid_t *raidPtr;
|
||||
rf_GetNumSpareRUsChainDecluster(RF_Raid_t *raidPtr)
|
||||
{
|
||||
RF_ChaindeclusterConfigInfo_t *info = (RF_ChaindeclusterConfigInfo_t *) raidPtr->Layout.layoutSpecificInfo;
|
||||
|
||||
@ -126,12 +123,9 @@ rf_GetNumSpareRUsChainDecluster(raidPtr)
|
||||
|
||||
/* Maps to the primary copy of the data, i.e. the first mirror pair */
|
||||
void
|
||||
rf_MapSectorChainDecluster(
|
||||
RF_Raid_t * raidPtr,
|
||||
RF_RaidAddr_t raidSector,
|
||||
RF_RowCol_t * col,
|
||||
RF_SectorNum_t * diskSector,
|
||||
int remap)
|
||||
rf_MapSectorChainDecluster(RF_Raid_t *raidPtr, RF_RaidAddr_t raidSector,
|
||||
RF_RowCol_t *col, RF_SectorNum_t *diskSector,
|
||||
int remap)
|
||||
{
|
||||
RF_ChaindeclusterConfigInfo_t *info = (RF_ChaindeclusterConfigInfo_t *) raidPtr->Layout.layoutSpecificInfo;
|
||||
RF_StripeNum_t SUID = raidSector / raidPtr->Layout.sectorsPerStripeUnit;
|
||||
@ -173,12 +167,9 @@ rf_MapSectorChainDecluster(
|
||||
in the next disk (mod numCol) after the disk containing the primary copy.
|
||||
The offset into the disk is one-half disk down */
|
||||
void
|
||||
rf_MapParityChainDecluster(
|
||||
RF_Raid_t * raidPtr,
|
||||
RF_RaidAddr_t raidSector,
|
||||
RF_RowCol_t * col,
|
||||
RF_SectorNum_t * diskSector,
|
||||
int remap)
|
||||
rf_MapParityChainDecluster(RF_Raid_t *raidPtr, RF_RaidAddr_t raidSector,
|
||||
RF_RowCol_t *col, RF_SectorNum_t *diskSector,
|
||||
int remap)
|
||||
{
|
||||
RF_ChaindeclusterConfigInfo_t *info = (RF_ChaindeclusterConfigInfo_t *) raidPtr->Layout.layoutSpecificInfo;
|
||||
RF_StripeNum_t SUID = raidSector / raidPtr->Layout.sectorsPerStripeUnit;
|
||||
@ -214,10 +205,8 @@ rf_MapParityChainDecluster(
|
||||
}
|
||||
|
||||
void
|
||||
rf_IdentifyStripeChainDecluster(
|
||||
RF_Raid_t * raidPtr,
|
||||
RF_RaidAddr_t addr,
|
||||
RF_RowCol_t ** diskids)
|
||||
rf_IdentifyStripeChainDecluster(RF_Raid_t *raidPtr, RF_RaidAddr_t addr,
|
||||
RF_RowCol_t **diskids)
|
||||
{
|
||||
RF_ChaindeclusterConfigInfo_t *info = (RF_ChaindeclusterConfigInfo_t *) raidPtr->Layout.layoutSpecificInfo;
|
||||
RF_StripeNum_t SUID;
|
||||
@ -229,11 +218,10 @@ rf_IdentifyStripeChainDecluster(
|
||||
}
|
||||
|
||||
void
|
||||
rf_MapSIDToPSIDChainDecluster(
|
||||
RF_RaidLayout_t * layoutPtr,
|
||||
RF_StripeNum_t stripeID,
|
||||
RF_StripeNum_t * psID,
|
||||
RF_ReconUnitNum_t * which_ru)
|
||||
rf_MapSIDToPSIDChainDecluster(RF_RaidLayout_t *layoutPtr,
|
||||
RF_StripeNum_t stripeID,
|
||||
RF_StripeNum_t *psID,
|
||||
RF_ReconUnitNum_t *which_ru)
|
||||
{
|
||||
*which_ru = 0;
|
||||
*psID = stripeID;
|
||||
@ -248,11 +236,8 @@ rf_MapSIDToPSIDChainDecluster(
|
||||
*****************************************************************************/
|
||||
|
||||
void
|
||||
rf_RAIDCDagSelect(
|
||||
RF_Raid_t * raidPtr,
|
||||
RF_IoType_t type,
|
||||
RF_AccessStripeMap_t * asmap,
|
||||
RF_VoidFuncPtr * createFunc)
|
||||
rf_RAIDCDagSelect(RF_Raid_t *raidPtr, RF_IoType_t type,
|
||||
RF_AccessStripeMap_t *asmap, RF_VoidFuncPtr *createFunc)
|
||||
#if 0
|
||||
void (**createFunc) (RF_Raid_t *, RF_AccessStripeMap_t *,
|
||||
RF_DagHeader_t *, void *, RF_RaidAccessFlags_t,
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: rf_copyback.c,v 1.26 2003/12/29 02:38:17 oster Exp $ */
|
||||
/* $NetBSD: rf_copyback.c,v 1.27 2003/12/30 21:59:03 oster Exp $ */
|
||||
/*
|
||||
* Copyright (c) 1995 Carnegie-Mellon University.
|
||||
* All rights reserved.
|
||||
@ -26,19 +26,19 @@
|
||||
* rights to redistribute these changes.
|
||||
*/
|
||||
|
||||
/*****************************************************************************************
|
||||
/*****************************************************************************
|
||||
*
|
||||
* copyback.c -- code to copy reconstructed data back from spare space to
|
||||
* the replaced disk.
|
||||
*
|
||||
* the code operates using callbacks on the I/Os to continue with the next
|
||||
* unit to be copied back. We do this because a simple loop containing blocking I/Os
|
||||
* will not work in the simulator.
|
||||
* the code operates using callbacks on the I/Os to continue with the
|
||||
* next unit to be copied back. We do this because a simple loop
|
||||
* containing blocking I/Os will not work in the simulator.
|
||||
*
|
||||
****************************************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: rf_copyback.c,v 1.26 2003/12/29 02:38:17 oster Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: rf_copyback.c,v 1.27 2003/12/30 21:59:03 oster Exp $");
|
||||
|
||||
#include <dev/raidframe/raidframevar.h>
|
||||
|
||||
@ -85,8 +85,7 @@ rf_ConfigureCopyback(listp)
|
||||
|
||||
/* do a complete copyback */
|
||||
void
|
||||
rf_CopybackReconstructedData(raidPtr)
|
||||
RF_Raid_t *raidPtr;
|
||||
rf_CopybackReconstructedData(RF_Raid_t *raidPtr)
|
||||
{
|
||||
RF_ComponentLabel_t c_label;
|
||||
int found, retcode;
|
||||
@ -239,8 +238,7 @@ rf_CopybackReconstructedData(raidPtr)
|
||||
* continue on with the next one
|
||||
*/
|
||||
void
|
||||
rf_ContinueCopyback(desc)
|
||||
RF_CopybackDesc_t *desc;
|
||||
rf_ContinueCopyback(RF_CopybackDesc_t *desc)
|
||||
{
|
||||
RF_SectorNum_t testOffs, stripeAddr;
|
||||
RF_Raid_t *raidPtr = desc->raidPtr;
|
||||
@ -317,12 +315,8 @@ rf_ContinueCopyback(desc)
|
||||
|
||||
/* copyback one unit */
|
||||
static void
|
||||
rf_CopybackOne(desc, typ, addr, testCol, testOffs)
|
||||
RF_CopybackDesc_t *desc;
|
||||
int typ;
|
||||
RF_RaidAddr_t addr;
|
||||
RF_RowCol_t testCol;
|
||||
RF_SectorNum_t testOffs;
|
||||
rf_CopybackOne(RF_CopybackDesc_t *desc, int typ, RF_RaidAddr_t addr,
|
||||
RF_RowCol_t testCol, RF_SectorNum_t testOffs)
|
||||
{
|
||||
RF_SectorCount_t sectPerSU = desc->sectPerSU;
|
||||
RF_Raid_t *raidPtr = desc->raidPtr;
|
||||
@ -372,9 +366,7 @@ rf_CopybackOne(desc, typ, addr, testCol, testOffs)
|
||||
|
||||
/* called at interrupt context when the read has completed. just send out the write */
|
||||
static int
|
||||
rf_CopybackReadDoneProc(desc, status)
|
||||
RF_CopybackDesc_t *desc;
|
||||
int status;
|
||||
rf_CopybackReadDoneProc(RF_CopybackDesc_t *desc, int status)
|
||||
{
|
||||
if (status) { /* invoke the callback with bad status */
|
||||
printf("raid%d: copyback read failed. Aborting.\n",
|
||||
@ -391,9 +383,7 @@ rf_CopybackReadDoneProc(desc, status)
|
||||
* can't free diskqueuedata structs in the kernel b/c we're at interrupt context.
|
||||
*/
|
||||
static int
|
||||
rf_CopybackWriteDoneProc(desc, status)
|
||||
RF_CopybackDesc_t *desc;
|
||||
int status;
|
||||
rf_CopybackWriteDoneProc(RF_CopybackDesc_t *desc, int status)
|
||||
{
|
||||
if (status && status != -100) {
|
||||
printf("raid%d: copyback write failed. Aborting.\n",
|
||||
@ -405,9 +395,7 @@ rf_CopybackWriteDoneProc(desc, status)
|
||||
}
|
||||
/* invoked when the copyback has completed */
|
||||
static void
|
||||
rf_CopybackComplete(desc, status)
|
||||
RF_CopybackDesc_t *desc;
|
||||
int status;
|
||||
rf_CopybackComplete(RF_CopybackDesc_t *desc, int status)
|
||||
{
|
||||
RF_Raid_t *raidPtr = desc->raidPtr;
|
||||
struct timeval t, diff;
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: rf_cvscan.c,v 1.10 2002/09/23 04:02:29 oster Exp $ */
|
||||
/* $NetBSD: rf_cvscan.c,v 1.11 2003/12/30 21:59:03 oster Exp $ */
|
||||
/*
|
||||
* Copyright (c) 1995 Carnegie-Mellon University.
|
||||
* All rights reserved.
|
||||
@ -35,7 +35,7 @@
|
||||
******************************************************************************/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: rf_cvscan.c,v 1.10 2002/09/23 04:02:29 oster Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: rf_cvscan.c,v 1.11 2003/12/30 21:59:03 oster Exp $");
|
||||
|
||||
#include <dev/raidframe/raidframevar.h>
|
||||
#include "rf_alloclist.h"
|
||||
@ -51,7 +51,7 @@ __KERNEL_RCSID(0, "$NetBSD: rf_cvscan.c,v 1.10 2002/09/23 04:02:29 oster Exp $")
|
||||
#define pri_ok(p) ( ((p) == RF_IO_NORMAL_PRIORITY) || ((p) == RF_IO_LOW_PRIORITY))
|
||||
|
||||
static void
|
||||
CheckCvscanState(RF_CvscanHeader_t * hdr)
|
||||
CheckCvscanState(RF_CvscanHeader_t *hdr)
|
||||
{
|
||||
long i, key;
|
||||
RF_DiskQueueData_t *tmp;
|
||||
@ -88,7 +88,7 @@ CheckCvscanState(RF_CvscanHeader_t * hdr)
|
||||
|
||||
|
||||
static void
|
||||
PriorityInsert(RF_DiskQueueData_t ** list_ptr, RF_DiskQueueData_t * req)
|
||||
PriorityInsert(RF_DiskQueueData_t **list_ptr, RF_DiskQueueData_t *req)
|
||||
{
|
||||
/* * insert block pointed to by req in to list whose first * entry is
|
||||
* pointed to by the pointer that list_ptr points to * ie., list_ptr
|
||||
@ -105,7 +105,7 @@ PriorityInsert(RF_DiskQueueData_t ** list_ptr, RF_DiskQueueData_t * req)
|
||||
|
||||
|
||||
static void
|
||||
ReqInsert(RF_DiskQueueData_t ** list_ptr, RF_DiskQueueData_t * req, RF_CvscanArmDir_t order)
|
||||
ReqInsert(RF_DiskQueueData_t **list_ptr, RF_DiskQueueData_t *req, RF_CvscanArmDir_t order)
|
||||
{
|
||||
/* * insert block pointed to by req in to list whose first * entry is
|
||||
* pointed to by the pointer that list_ptr points to * ie., list_ptr
|
||||
@ -124,7 +124,7 @@ ReqInsert(RF_DiskQueueData_t ** list_ptr, RF_DiskQueueData_t * req, RF_CvscanArm
|
||||
|
||||
|
||||
static RF_DiskQueueData_t *
|
||||
ReqDequeue(RF_DiskQueueData_t ** list_ptr)
|
||||
ReqDequeue(RF_DiskQueueData_t **list_ptr)
|
||||
{
|
||||
RF_DiskQueueData_t *ret = (*list_ptr);
|
||||
if ((*list_ptr) != (RF_DiskQueueData_t *) NULL) {
|
||||
@ -136,7 +136,7 @@ ReqDequeue(RF_DiskQueueData_t ** list_ptr)
|
||||
|
||||
|
||||
static void
|
||||
ReBalance(RF_CvscanHeader_t * hdr)
|
||||
ReBalance(RF_CvscanHeader_t *hdr)
|
||||
{
|
||||
/* DO_CHECK_STATE(hdr); */
|
||||
while (hdr->right != (RF_DiskQueueData_t *) NULL
|
||||
@ -151,7 +151,7 @@ ReBalance(RF_CvscanHeader_t * hdr)
|
||||
|
||||
|
||||
static void
|
||||
Transfer(RF_DiskQueueData_t ** to_list_ptr, RF_DiskQueueData_t ** from_list_ptr)
|
||||
Transfer(RF_DiskQueueData_t **to_list_ptr, RF_DiskQueueData_t **from_list_ptr)
|
||||
{
|
||||
RF_DiskQueueData_t *gp;
|
||||
for (gp = (*from_list_ptr); gp != (RF_DiskQueueData_t *) NULL;) {
|
||||
@ -165,7 +165,7 @@ Transfer(RF_DiskQueueData_t ** to_list_ptr, RF_DiskQueueData_t ** from_list_ptr)
|
||||
|
||||
|
||||
static void
|
||||
RealEnqueue(RF_CvscanHeader_t * hdr, RF_DiskQueueData_t * req)
|
||||
RealEnqueue(RF_CvscanHeader_t *hdr, RF_DiskQueueData_t *req)
|
||||
{
|
||||
RF_ASSERT(req->priority == RF_IO_NORMAL_PRIORITY || req->priority == RF_IO_LOW_PRIORITY);
|
||||
|
||||
@ -321,8 +321,8 @@ rf_CvscanPeek(void *q_in)
|
||||
|
||||
void *
|
||||
rf_CvscanCreate(RF_SectorCount_t sectPerDisk,
|
||||
RF_AllocListElem_t * clList,
|
||||
RF_ShutdownList_t ** listp)
|
||||
RF_AllocListElem_t *clList,
|
||||
RF_ShutdownList_t **listp)
|
||||
{
|
||||
RF_CvscanHeader_t *hdr;
|
||||
long range = 2; /* Currently no mechanism to change these */
|
||||
@ -347,7 +347,7 @@ rf_CvscanCreate(RF_SectorCount_t sectPerDisk,
|
||||
/* PrintCvscanQueue is not used, so we ignore it... */
|
||||
#else
|
||||
static void
|
||||
PrintCvscanQueue(RF_CvscanHeader_t * hdr)
|
||||
PrintCvscanQueue(RF_CvscanHeader_t *hdr)
|
||||
{
|
||||
RF_DiskQueueData_t *tmp;
|
||||
|
||||
@ -387,7 +387,8 @@ PrintCvscanQueue(RF_CvscanHeader_t * hdr)
|
||||
* be short.
|
||||
*/
|
||||
int
|
||||
rf_CvscanPromote(void *q_in, RF_StripeNum_t parityStripeID, RF_ReconUnitNum_t which_ru)
|
||||
rf_CvscanPromote(void *q_in, RF_StripeNum_t parityStripeID,
|
||||
RF_ReconUnitNum_t which_ru)
|
||||
{
|
||||
RF_CvscanHeader_t *hdr = (RF_CvscanHeader_t *) q_in;
|
||||
RF_DiskQueueData_t *trailer = NULL, *tmp = hdr->burner, *tlist = NULL;
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: rf_dagdegrd.c,v 1.15 2003/12/29 03:33:47 oster Exp $ */
|
||||
/* $NetBSD: rf_dagdegrd.c,v 1.16 2003/12/30 21:59:03 oster 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.15 2003/12/29 03:33:47 oster Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: rf_dagdegrd.c,v 1.16 2003/12/30 21:59:03 oster Exp $");
|
||||
|
||||
#include <dev/raidframe/raidframevar.h>
|
||||
|
||||
@ -75,13 +75,12 @@ __KERNEL_RCSID(0, "$NetBSD: rf_dagdegrd.c,v 1.15 2003/12/29 03:33:47 oster Exp $
|
||||
*/
|
||||
|
||||
void
|
||||
rf_CreateRaidFiveDegradedReadDAG(
|
||||
RF_Raid_t * raidPtr,
|
||||
RF_AccessStripeMap_t * asmap,
|
||||
RF_DagHeader_t * dag_h,
|
||||
void *bp,
|
||||
RF_RaidAccessFlags_t flags,
|
||||
RF_AllocListElem_t * allocList)
|
||||
rf_CreateRaidFiveDegradedReadDAG(RF_Raid_t *raidPtr,
|
||||
RF_AccessStripeMap_t *asmap,
|
||||
RF_DagHeader_t *dag_h,
|
||||
void *bp,
|
||||
RF_RaidAccessFlags_t flags,
|
||||
RF_AllocListElem_t *allocList)
|
||||
{
|
||||
rf_CreateDegradedReadDAG(raidPtr, asmap, dag_h, bp, flags, allocList,
|
||||
&rf_xorRecoveryFuncs);
|
||||
@ -111,13 +110,12 @@ rf_CreateRaidFiveDegradedReadDAG(
|
||||
*****************************************************************************/
|
||||
|
||||
void
|
||||
rf_CreateRaidOneDegradedReadDAG(
|
||||
RF_Raid_t * raidPtr,
|
||||
RF_AccessStripeMap_t * asmap,
|
||||
RF_DagHeader_t * dag_h,
|
||||
void *bp,
|
||||
RF_RaidAccessFlags_t flags,
|
||||
RF_AllocListElem_t * allocList)
|
||||
rf_CreateRaidOneDegradedReadDAG(RF_Raid_t *raidPtr,
|
||||
RF_AccessStripeMap_t *asmap,
|
||||
RF_DagHeader_t *dag_h,
|
||||
void *bp,
|
||||
RF_RaidAccessFlags_t flags,
|
||||
RF_AllocListElem_t *allocList)
|
||||
{
|
||||
RF_DagNode_t *nodes, *rdNode, *blockNode, *commitNode, *termNode;
|
||||
RF_StripeNum_t parityStripeID;
|
||||
@ -250,14 +248,11 @@ rf_CreateRaidOneDegradedReadDAG(
|
||||
*****************************************************************************/
|
||||
|
||||
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,
|
||||
const RF_RedFuncs_t * recFunc)
|
||||
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,
|
||||
const RF_RedFuncs_t *recFunc)
|
||||
{
|
||||
RF_DagNode_t *nodes, *rudNodes, *rrdNodes, *xorNode, *blockNode;
|
||||
RF_DagNode_t *commitNode, *rpNode, *termNode;
|
||||
@ -526,13 +521,10 @@ rf_CreateDegradedReadDAG(
|
||||
*****************************************************************************/
|
||||
|
||||
void
|
||||
rf_CreateRaidCDegradedReadDAG(
|
||||
RF_Raid_t * raidPtr,
|
||||
RF_AccessStripeMap_t * asmap,
|
||||
RF_DagHeader_t * dag_h,
|
||||
void *bp,
|
||||
RF_RaidAccessFlags_t flags,
|
||||
RF_AllocListElem_t * allocList)
|
||||
rf_CreateRaidCDegradedReadDAG(RF_Raid_t *raidPtr, RF_AccessStripeMap_t *asmap,
|
||||
RF_DagHeader_t *dag_h, void *bp,
|
||||
RF_RaidAccessFlags_t flags,
|
||||
RF_AllocListElem_t *allocList)
|
||||
{
|
||||
RF_DagNode_t *nodes, *rdNode, *blockNode, *commitNode, *termNode;
|
||||
RF_StripeNum_t parityStripeID;
|
||||
@ -654,14 +646,10 @@ rf_CreateRaidCDegradedReadDAG(
|
||||
* XXX move this elsewhere?
|
||||
*/
|
||||
void
|
||||
rf_DD_GenerateFailedAccessASMs(
|
||||
RF_Raid_t * raidPtr,
|
||||
RF_AccessStripeMap_t * asmap,
|
||||
RF_PhysDiskAddr_t ** pdap,
|
||||
int *nNodep,
|
||||
RF_PhysDiskAddr_t ** pqpdap,
|
||||
int *nPQNodep,
|
||||
RF_AllocListElem_t * allocList)
|
||||
rf_DD_GenerateFailedAccessASMs(RF_Raid_t *raidPtr, RF_AccessStripeMap_t *asmap,
|
||||
RF_PhysDiskAddr_t **pdap, int *nNodep,
|
||||
RF_PhysDiskAddr_t **pqpdap, int *nPQNodep,
|
||||
RF_AllocListElem_t *allocList)
|
||||
{
|
||||
RF_RaidLayout_t *layoutPtr = &(raidPtr->Layout);
|
||||
int PDAPerDisk, i;
|
||||
@ -987,16 +975,11 @@ rf_InitNode(node, rf_wait, RF_FALSE, rf_DiskReadFunc, rf_DiskReadUndoFunc, rf_Ge
|
||||
(_node_).params[3].v = RF_CREATE_PARAM3(RF_IO_NORMAL_PRIORITY, 0, 0, which_ru)
|
||||
|
||||
void
|
||||
rf_DoubleDegRead(
|
||||
RF_Raid_t * raidPtr,
|
||||
RF_AccessStripeMap_t * asmap,
|
||||
RF_DagHeader_t * dag_h,
|
||||
void *bp,
|
||||
RF_RaidAccessFlags_t flags,
|
||||
RF_AllocListElem_t * allocList,
|
||||
char *redundantReadNodeName,
|
||||
char *recoveryNodeName,
|
||||
int (*recovFunc) (RF_DagNode_t *))
|
||||
rf_DoubleDegRead(RF_Raid_t *raidPtr, RF_AccessStripeMap_t *asmap,
|
||||
RF_DagHeader_t *dag_h, void *bp, RF_RaidAccessFlags_t flags,
|
||||
RF_AllocListElem_t *allocList,
|
||||
char *redundantReadNodeName, char *recoveryNodeName,
|
||||
int (*recovFunc) (RF_DagNode_t *))
|
||||
{
|
||||
RF_RaidLayout_t *layoutPtr = &(raidPtr->Layout);
|
||||
RF_DagNode_t *nodes, *rudNodes, *rrdNodes, *recoveryNode, *blockNode,
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: rf_dagdegwr.c,v 1.13 2003/12/29 03:33:47 oster Exp $ */
|
||||
/* $NetBSD: rf_dagdegwr.c,v 1.14 2003/12/30 21:59:03 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.13 2003/12/29 03:33:47 oster Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: rf_dagdegwr.c,v 1.14 2003/12/30 21:59:03 oster Exp $");
|
||||
|
||||
#include <dev/raidframe/raidframevar.h>
|
||||
|
||||
@ -82,13 +82,10 @@ RF_CREATE_DAG_FUNC_DECL(rf_CreateSimpleDegradedWriteDAG)
|
||||
}
|
||||
|
||||
void
|
||||
rf_CreateDegradedWriteDAG(raidPtr, asmap, dag_h, bp, flags, allocList)
|
||||
RF_Raid_t *raidPtr;
|
||||
RF_AccessStripeMap_t *asmap;
|
||||
RF_DagHeader_t *dag_h;
|
||||
void *bp;
|
||||
RF_RaidAccessFlags_t flags;
|
||||
RF_AllocListElem_t *allocList;
|
||||
rf_CreateDegradedWriteDAG(RF_Raid_t *raidPtr, RF_AccessStripeMap_t *asmap,
|
||||
RF_DagHeader_t *dag_h, void *bp,
|
||||
RF_RaidAccessFlags_t flags,
|
||||
RF_AllocListElem_t *allocList)
|
||||
{
|
||||
|
||||
RF_ASSERT(asmap->numDataFailed == 1);
|
||||
@ -154,17 +151,14 @@ rf_CreateDegradedWriteDAG(raidPtr, asmap, dag_h, bp, flags, allocList)
|
||||
*****************************************************************************/
|
||||
|
||||
void
|
||||
rf_CommonCreateSimpleDegradedWriteDAG(raidPtr, asmap, dag_h, bp, flags,
|
||||
allocList, nfaults, redFunc, allowBufferRecycle)
|
||||
RF_Raid_t *raidPtr;
|
||||
RF_AccessStripeMap_t *asmap;
|
||||
RF_DagHeader_t *dag_h;
|
||||
void *bp;
|
||||
RF_RaidAccessFlags_t flags;
|
||||
RF_AllocListElem_t *allocList;
|
||||
int nfaults;
|
||||
int (*redFunc) (RF_DagNode_t *);
|
||||
int allowBufferRecycle;
|
||||
rf_CommonCreateSimpleDegradedWriteDAG(RF_Raid_t *raidPtr,
|
||||
RF_AccessStripeMap_t *asmap,
|
||||
RF_DagHeader_t *dag_h, void *bp,
|
||||
RF_RaidAccessFlags_t flags,
|
||||
RF_AllocListElem_t *allocList,
|
||||
int nfaults,
|
||||
int (*redFunc) (RF_DagNode_t *),
|
||||
int allowBufferRecycle)
|
||||
{
|
||||
int nNodes, nRrdNodes, nWndNodes, nXorBufs, i, j, paramNum,
|
||||
rdnodesFaked;
|
||||
@ -659,17 +653,14 @@ rf_WriteGenerateFailedAccessASMs(
|
||||
(_node_).params[3].v = RF_CREATE_PARAM3(RF_IO_NORMAL_PRIORITY, 0, 0, which_ru)
|
||||
|
||||
void
|
||||
rf_DoubleDegSmallWrite(
|
||||
RF_Raid_t * raidPtr,
|
||||
RF_AccessStripeMap_t * asmap,
|
||||
RF_DagHeader_t * dag_h,
|
||||
void *bp,
|
||||
RF_RaidAccessFlags_t flags,
|
||||
RF_AllocListElem_t * allocList,
|
||||
char *redundantReadNodeName,
|
||||
char *redundantWriteNodeName,
|
||||
char *recoveryNodeName,
|
||||
int (*recovFunc) (RF_DagNode_t *))
|
||||
rf_DoubleDegSmallWrite(RF_Raid_t *raidPtr, RF_AccessStripeMap_t *asmap,
|
||||
RF_DagHeader_t *dag_h, void *bp,
|
||||
RF_RaidAccessFlags_t flags,
|
||||
RF_AllocListElem_t *allocList,
|
||||
char *redundantReadNodeName,
|
||||
char *redundantWriteNodeName,
|
||||
char *recoveryNodeName,
|
||||
int (*recovFunc) (RF_DagNode_t *))
|
||||
{
|
||||
RF_RaidLayout_t *layoutPtr = &(raidPtr->Layout);
|
||||
RF_DagNode_t *nodes, *wudNodes, *rrdNodes, *recoveryNode, *blockNode,
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: rf_dagffrd.c,v 1.9 2003/12/29 03:33:47 oster Exp $ */
|
||||
/* $NetBSD: rf_dagffrd.c,v 1.10 2003/12/30 21:59:03 oster Exp $ */
|
||||
/*
|
||||
* Copyright (c) 1995 Carnegie-Mellon University.
|
||||
* All rights reserved.
|
||||
@ -34,7 +34,7 @@
|
||||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: rf_dagffrd.c,v 1.9 2003/12/29 03:33:47 oster Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: rf_dagffrd.c,v 1.10 2003/12/30 21:59:03 oster Exp $");
|
||||
|
||||
#include <dev/raidframe/raidframevar.h>
|
||||
|
||||
@ -74,13 +74,10 @@ __KERNEL_RCSID(0, "$NetBSD: rf_dagffrd.c,v 1.9 2003/12/29 03:33:47 oster Exp $")
|
||||
*/
|
||||
|
||||
void
|
||||
rf_CreateFaultFreeReadDAG(
|
||||
RF_Raid_t * raidPtr,
|
||||
RF_AccessStripeMap_t * asmap,
|
||||
RF_DagHeader_t * dag_h,
|
||||
void *bp,
|
||||
RF_RaidAccessFlags_t flags,
|
||||
RF_AllocListElem_t * allocList)
|
||||
rf_CreateFaultFreeReadDAG(RF_Raid_t *raidPtr, RF_AccessStripeMap_t *asmap,
|
||||
RF_DagHeader_t *dag_h, void *bp,
|
||||
RF_RaidAccessFlags_t flags,
|
||||
RF_AllocListElem_t *allocList)
|
||||
{
|
||||
rf_CreateNonredundantDAG(raidPtr, asmap, dag_h, bp, flags, allocList,
|
||||
RF_IO_TYPE_READ);
|
||||
@ -127,14 +124,11 @@ rf_CreateFaultFreeReadDAG(
|
||||
*****************************************************************************/
|
||||
|
||||
void
|
||||
rf_CreateNonredundantDAG(
|
||||
RF_Raid_t * raidPtr,
|
||||
RF_AccessStripeMap_t * asmap,
|
||||
RF_DagHeader_t * dag_h,
|
||||
void *bp,
|
||||
RF_RaidAccessFlags_t flags,
|
||||
RF_AllocListElem_t * allocList,
|
||||
RF_IoType_t type)
|
||||
rf_CreateNonredundantDAG(RF_Raid_t *raidPtr, RF_AccessStripeMap_t *asmap,
|
||||
RF_DagHeader_t *dag_h, void *bp,
|
||||
RF_RaidAccessFlags_t flags,
|
||||
RF_AllocListElem_t *allocList,
|
||||
RF_IoType_t type)
|
||||
{
|
||||
RF_DagNode_t *nodes, *diskNodes, *blockNode, *commitNode, *termNode;
|
||||
RF_PhysDiskAddr_t *pda = asmap->physInfo;
|
||||
@ -306,14 +300,11 @@ rf_CreateNonredundantDAG(
|
||||
*****************************************************************************/
|
||||
|
||||
static void
|
||||
CreateMirrorReadDAG(
|
||||
RF_Raid_t * raidPtr,
|
||||
RF_AccessStripeMap_t * asmap,
|
||||
RF_DagHeader_t * dag_h,
|
||||
void *bp,
|
||||
RF_RaidAccessFlags_t flags,
|
||||
RF_AllocListElem_t * allocList,
|
||||
int (*readfunc) (RF_DagNode_t * node))
|
||||
CreateMirrorReadDAG(RF_Raid_t *raidPtr, RF_AccessStripeMap_t *asmap,
|
||||
RF_DagHeader_t *dag_h, void *bp,
|
||||
RF_RaidAccessFlags_t flags,
|
||||
RF_AllocListElem_t *allocList,
|
||||
int (*readfunc) (RF_DagNode_t * node))
|
||||
{
|
||||
RF_DagNode_t *readNodes, *nodes, *blockNode, *commitNode, *termNode;
|
||||
RF_PhysDiskAddr_t *data_pda = asmap->physInfo;
|
||||
@ -430,13 +421,11 @@ rf_CreateMirrorIdleReadDAG(
|
||||
#if (RF_INCLUDE_CHAINDECLUSTER > 0) || (RF_INCLUDE_INTERDECLUSTER > 0)
|
||||
|
||||
void
|
||||
rf_CreateMirrorPartitionReadDAG(
|
||||
RF_Raid_t * raidPtr,
|
||||
RF_AccessStripeMap_t * asmap,
|
||||
RF_DagHeader_t * dag_h,
|
||||
void *bp,
|
||||
RF_RaidAccessFlags_t flags,
|
||||
RF_AllocListElem_t * allocList)
|
||||
rf_CreateMirrorPartitionReadDAG(RF_Raid_t *raidPtr,
|
||||
RF_AccessStripeMap_t *asmap,
|
||||
RF_DagHeader_t *dag_h, void *bp,
|
||||
RF_RaidAccessFlags_t flags,
|
||||
RF_AllocListElem_t *allocList)
|
||||
{
|
||||
CreateMirrorReadDAG(raidPtr, asmap, dag_h, bp, flags, allocList,
|
||||
rf_DiskReadMirrorPartitionFunc);
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: rf_dagffwr.c,v 1.12 2003/12/29 03:33:47 oster Exp $ */
|
||||
/* $NetBSD: rf_dagffwr.c,v 1.13 2003/12/30 21:59:03 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.12 2003/12/29 03:33:47 oster Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: rf_dagffwr.c,v 1.13 2003/12/30 21:59:03 oster Exp $");
|
||||
|
||||
#include <dev/raidframe/raidframevar.h>
|
||||
|
||||
@ -76,41 +76,32 @@ __KERNEL_RCSID(0, "$NetBSD: rf_dagffwr.c,v 1.12 2003/12/29 03:33:47 oster Exp $"
|
||||
|
||||
|
||||
void
|
||||
rf_CreateNonRedundantWriteDAG(
|
||||
RF_Raid_t * raidPtr,
|
||||
RF_AccessStripeMap_t * asmap,
|
||||
RF_DagHeader_t * dag_h,
|
||||
void *bp,
|
||||
RF_RaidAccessFlags_t flags,
|
||||
RF_AllocListElem_t * allocList,
|
||||
RF_IoType_t type)
|
||||
rf_CreateNonRedundantWriteDAG(RF_Raid_t *raidPtr, RF_AccessStripeMap_t *asmap,
|
||||
RF_DagHeader_t *dag_h, void *bp,
|
||||
RF_RaidAccessFlags_t flags,
|
||||
RF_AllocListElem_t *allocList,
|
||||
RF_IoType_t type)
|
||||
{
|
||||
rf_CreateNonredundantDAG(raidPtr, asmap, dag_h, bp, flags, allocList,
|
||||
RF_IO_TYPE_WRITE);
|
||||
}
|
||||
|
||||
void
|
||||
rf_CreateRAID0WriteDAG(
|
||||
RF_Raid_t * raidPtr,
|
||||
RF_AccessStripeMap_t * asmap,
|
||||
RF_DagHeader_t * dag_h,
|
||||
void *bp,
|
||||
RF_RaidAccessFlags_t flags,
|
||||
RF_AllocListElem_t * allocList,
|
||||
RF_IoType_t type)
|
||||
rf_CreateRAID0WriteDAG(RF_Raid_t *raidPtr, RF_AccessStripeMap_t *asmap,
|
||||
RF_DagHeader_t *dag_h, void *bp,
|
||||
RF_RaidAccessFlags_t flags,
|
||||
RF_AllocListElem_t *allocList,
|
||||
RF_IoType_t type)
|
||||
{
|
||||
rf_CreateNonredundantDAG(raidPtr, asmap, dag_h, bp, flags, allocList,
|
||||
RF_IO_TYPE_WRITE);
|
||||
}
|
||||
|
||||
void
|
||||
rf_CreateSmallWriteDAG(
|
||||
RF_Raid_t * raidPtr,
|
||||
RF_AccessStripeMap_t * asmap,
|
||||
RF_DagHeader_t * dag_h,
|
||||
void *bp,
|
||||
RF_RaidAccessFlags_t flags,
|
||||
RF_AllocListElem_t * allocList)
|
||||
rf_CreateSmallWriteDAG(RF_Raid_t *raidPtr, RF_AccessStripeMap_t *asmap,
|
||||
RF_DagHeader_t *dag_h, void *bp,
|
||||
RF_RaidAccessFlags_t flags,
|
||||
RF_AllocListElem_t *allocList)
|
||||
{
|
||||
/* "normal" rollaway */
|
||||
rf_CommonCreateSmallWriteDAG(raidPtr, asmap, dag_h, bp, flags, allocList,
|
||||
@ -118,13 +109,10 @@ rf_CreateSmallWriteDAG(
|
||||
}
|
||||
|
||||
void
|
||||
rf_CreateLargeWriteDAG(
|
||||
RF_Raid_t * raidPtr,
|
||||
RF_AccessStripeMap_t * asmap,
|
||||
RF_DagHeader_t * dag_h,
|
||||
void *bp,
|
||||
RF_RaidAccessFlags_t flags,
|
||||
RF_AllocListElem_t * allocList)
|
||||
rf_CreateLargeWriteDAG(RF_Raid_t *raidPtr, RF_AccessStripeMap_t *asmap,
|
||||
RF_DagHeader_t *dag_h, void *bp,
|
||||
RF_RaidAccessFlags_t flags,
|
||||
RF_AllocListElem_t *allocList)
|
||||
{
|
||||
/* "normal" rollaway */
|
||||
rf_CommonCreateLargeWriteDAG(raidPtr, asmap, dag_h, bp, flags, allocList,
|
||||
@ -170,16 +158,12 @@ rf_CreateLargeWriteDAG(
|
||||
*****************************************************************************/
|
||||
|
||||
void
|
||||
rf_CommonCreateLargeWriteDAG(
|
||||
RF_Raid_t * raidPtr,
|
||||
RF_AccessStripeMap_t * asmap,
|
||||
RF_DagHeader_t * dag_h,
|
||||
void *bp,
|
||||
RF_RaidAccessFlags_t flags,
|
||||
RF_AllocListElem_t * allocList,
|
||||
int nfaults,
|
||||
int (*redFunc) (RF_DagNode_t *),
|
||||
int allowBufferRecycle)
|
||||
rf_CommonCreateLargeWriteDAG(RF_Raid_t *raidPtr, RF_AccessStripeMap_t *asmap,
|
||||
RF_DagHeader_t *dag_h, void *bp,
|
||||
RF_RaidAccessFlags_t flags,
|
||||
RF_AllocListElem_t *allocList,
|
||||
int nfaults, int (*redFunc) (RF_DagNode_t *),
|
||||
int allowBufferRecycle)
|
||||
{
|
||||
RF_DagNode_t *nodes, *wndNodes, *rodNodes, *xorNode, *wnpNode;
|
||||
RF_DagNode_t *wnqNode, *blockNode, *commitNode, *termNode;
|
||||
@ -465,15 +449,12 @@ rf_CommonCreateLargeWriteDAG(
|
||||
*****************************************************************************/
|
||||
|
||||
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,
|
||||
const RF_RedFuncs_t * pfuncs,
|
||||
const RF_RedFuncs_t * qfuncs)
|
||||
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,
|
||||
const RF_RedFuncs_t *pfuncs,
|
||||
const RF_RedFuncs_t *qfuncs)
|
||||
{
|
||||
RF_DagNode_t *readDataNodes, *readParityNodes, *readQNodes, *termNode;
|
||||
RF_DagNode_t *unlockDataNodes, *unlockParityNodes, *unlockQNodes;
|
||||
@ -1065,13 +1046,10 @@ rf_CommonCreateSmallWriteDAG(
|
||||
*****************************************************************************/
|
||||
|
||||
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)
|
||||
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)
|
||||
{
|
||||
RF_DagNode_t *unblockNode, *termNode, *commitNode;
|
||||
RF_DagNode_t *nodes, *wndNode, *wmirNode;
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: rf_dagfuncs.c,v 1.14 2003/12/29 03:43:07 oster Exp $ */
|
||||
/* $NetBSD: rf_dagfuncs.c,v 1.15 2003/12/30 21:59:03 oster Exp $ */
|
||||
/*
|
||||
* Copyright (c) 1995 Carnegie-Mellon University.
|
||||
* All rights reserved.
|
||||
@ -48,7 +48,7 @@
|
||||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: rf_dagfuncs.c,v 1.14 2003/12/29 03:43:07 oster Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: rf_dagfuncs.c,v 1.15 2003/12/30 21:59:03 oster Exp $");
|
||||
|
||||
#include <sys/param.h>
|
||||
#include <sys/ioctl.h>
|
||||
@ -85,8 +85,7 @@ int (*rf_RecoveryXorUndoFunc) (RF_DagNode_t *);
|
||||
* main (only) configuration routine for this module
|
||||
****************************************************************************/
|
||||
int
|
||||
rf_ConfigureDAGFuncs(listp)
|
||||
RF_ShutdownList_t **listp;
|
||||
rf_ConfigureDAGFuncs(RF_ShutdownList_t **listp)
|
||||
{
|
||||
RF_ASSERT(((sizeof(long) == 8) && RF_LONGSHIFT == 3) ||
|
||||
((sizeof(long) == 4) && RF_LONGSHIFT == 2));
|
||||
@ -108,8 +107,7 @@ rf_ConfigureDAGFuncs(listp)
|
||||
* the execution function associated with a terminate node
|
||||
****************************************************************************/
|
||||
int
|
||||
rf_TerminateFunc(node)
|
||||
RF_DagNode_t *node;
|
||||
rf_TerminateFunc(RF_DagNode_t *node)
|
||||
{
|
||||
RF_ASSERT(node->dagHdr->numCommits == node->dagHdr->numCommitNodes);
|
||||
node->status = rf_good;
|
||||
@ -117,14 +115,13 @@ rf_TerminateFunc(node)
|
||||
}
|
||||
|
||||
int
|
||||
rf_TerminateUndoFunc(node)
|
||||
RF_DagNode_t *node;
|
||||
rf_TerminateUndoFunc(RF_DagNode_t *node)
|
||||
{
|
||||
return (0);
|
||||
}
|
||||
|
||||
|
||||
/*****************************************************************************************
|
||||
/*****************************************************************************
|
||||
* execution functions associated with a mirror node
|
||||
*
|
||||
* parameters:
|
||||
@ -135,11 +132,10 @@ rf_TerminateUndoFunc(node)
|
||||
* 3 - flags
|
||||
* 4 - physical disk address of mirror (parity)
|
||||
*
|
||||
****************************************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
int
|
||||
rf_DiskReadMirrorIdleFunc(node)
|
||||
RF_DagNode_t *node;
|
||||
rf_DiskReadMirrorIdleFunc(RF_DagNode_t *node)
|
||||
{
|
||||
/* select the mirror copy with the shortest queue and fill in node
|
||||
* parameters with physical disk address */
|
||||
@ -150,8 +146,7 @@ rf_DiskReadMirrorIdleFunc(node)
|
||||
|
||||
#if (RF_INCLUDE_CHAINDECLUSTER > 0) || (RF_INCLUDE_INTERDECLUSTER > 0) || (RF_DEBUG_VALIDATE_DAG > 0)
|
||||
int
|
||||
rf_DiskReadMirrorPartitionFunc(node)
|
||||
RF_DagNode_t *node;
|
||||
rf_DiskReadMirrorPartitionFunc(RF_DagNode_t *node)
|
||||
{
|
||||
/* select the mirror copy with the shortest queue and fill in node
|
||||
* parameters with physical disk address */
|
||||
@ -162,8 +157,7 @@ rf_DiskReadMirrorPartitionFunc(node)
|
||||
#endif
|
||||
|
||||
int
|
||||
rf_DiskReadMirrorUndoFunc(node)
|
||||
RF_DagNode_t *node;
|
||||
rf_DiskReadMirrorUndoFunc(RF_DagNode_t *node)
|
||||
{
|
||||
return (0);
|
||||
}
|
||||
@ -175,8 +169,7 @@ rf_DiskReadMirrorUndoFunc(node)
|
||||
* the execution function associated with a parity log update node
|
||||
****************************************************************************/
|
||||
int
|
||||
rf_ParityLogUpdateFunc(node)
|
||||
RF_DagNode_t *node;
|
||||
rf_ParityLogUpdateFunc(RF_DagNode_t *node)
|
||||
{
|
||||
RF_PhysDiskAddr_t *pda = (RF_PhysDiskAddr_t *) node->params[0].p;
|
||||
caddr_t buf = (caddr_t) node->params[1].p;
|
||||
@ -203,12 +196,11 @@ rf_ParityLogUpdateFunc(node)
|
||||
}
|
||||
|
||||
|
||||
/*****************************************************************************************
|
||||
/*****************************************************************************
|
||||
* the execution function associated with a parity log overwrite node
|
||||
****************************************************************************************/
|
||||
****************************************************************************/
|
||||
int
|
||||
rf_ParityLogOverwriteFunc(node)
|
||||
RF_DagNode_t *node;
|
||||
rf_ParityLogOverwriteFunc(RF_DagNode_t *node)
|
||||
{
|
||||
RF_PhysDiskAddr_t *pda = (RF_PhysDiskAddr_t *) node->params[0].p;
|
||||
caddr_t buf = (caddr_t) node->params[1].p;
|
||||
@ -234,15 +226,13 @@ rf_ParityLogOverwriteFunc(node)
|
||||
}
|
||||
|
||||
int
|
||||
rf_ParityLogUpdateUndoFunc(node)
|
||||
RF_DagNode_t *node;
|
||||
rf_ParityLogUpdateUndoFunc(RF_DagNode_t *node)
|
||||
{
|
||||
return (0);
|
||||
}
|
||||
|
||||
int
|
||||
rf_ParityLogOverwriteUndoFunc(node)
|
||||
RF_DagNode_t *node;
|
||||
rf_ParityLogOverwriteUndoFunc(RF_DagNode_t *node)
|
||||
{
|
||||
return (0);
|
||||
}
|
||||
@ -252,16 +242,14 @@ rf_ParityLogOverwriteUndoFunc(node)
|
||||
* the execution function associated with a NOP node
|
||||
****************************************************************************/
|
||||
int
|
||||
rf_NullNodeFunc(node)
|
||||
RF_DagNode_t *node;
|
||||
rf_NullNodeFunc(RF_DagNode_t *node)
|
||||
{
|
||||
node->status = rf_good;
|
||||
return (rf_FinishNode(node, RF_THREAD_CONTEXT));
|
||||
}
|
||||
|
||||
int
|
||||
rf_NullNodeUndoFunc(node)
|
||||
RF_DagNode_t *node;
|
||||
rf_NullNodeUndoFunc(RF_DagNode_t *node)
|
||||
{
|
||||
node->status = rf_undone;
|
||||
return (rf_FinishNode(node, RF_THREAD_CONTEXT));
|
||||
@ -272,8 +260,7 @@ rf_NullNodeUndoFunc(node)
|
||||
* the execution function associated with a disk-read node
|
||||
****************************************************************************/
|
||||
int
|
||||
rf_DiskReadFuncForThreads(node)
|
||||
RF_DagNode_t *node;
|
||||
rf_DiskReadFuncForThreads(RF_DagNode_t *node)
|
||||
{
|
||||
RF_DiskQueueData_t *req;
|
||||
RF_PhysDiskAddr_t *pda = (RF_PhysDiskAddr_t *) node->params[0].p;
|
||||
@ -314,8 +301,7 @@ rf_DiskReadFuncForThreads(node)
|
||||
* the execution function associated with a disk-write node
|
||||
****************************************************************************/
|
||||
int
|
||||
rf_DiskWriteFuncForThreads(node)
|
||||
RF_DagNode_t *node;
|
||||
rf_DiskWriteFuncForThreads(RF_DagNode_t *node)
|
||||
{
|
||||
RF_DiskQueueData_t *req;
|
||||
RF_PhysDiskAddr_t *pda = (RF_PhysDiskAddr_t *) node->params[0].p;
|
||||
@ -360,8 +346,7 @@ rf_DiskWriteFuncForThreads(node)
|
||||
* old data is not restored to disk!
|
||||
****************************************************************************/
|
||||
int
|
||||
rf_DiskUndoFunc(node)
|
||||
RF_DagNode_t *node;
|
||||
rf_DiskUndoFunc(RF_DagNode_t *node)
|
||||
{
|
||||
RF_DiskQueueData_t *req;
|
||||
RF_PhysDiskAddr_t *pda = (RF_PhysDiskAddr_t *) node->params[0].p;
|
||||
@ -387,8 +372,7 @@ rf_DiskUndoFunc(node)
|
||||
* the execution function associated with an "unlock disk queue" node
|
||||
****************************************************************************/
|
||||
int
|
||||
rf_DiskUnlockFuncForThreads(node)
|
||||
RF_DagNode_t *node;
|
||||
rf_DiskUnlockFuncForThreads(RF_DagNode_t *node)
|
||||
{
|
||||
RF_DiskQueueData_t *req;
|
||||
RF_PhysDiskAddr_t *pda = (RF_PhysDiskAddr_t *) node->params[0].p;
|
||||
@ -416,10 +400,9 @@ rf_DiskUnlockFuncForThreads(node)
|
||||
* inform the execution engine that the node has fired.
|
||||
****************************************************************************/
|
||||
int
|
||||
rf_GenericWakeupFunc(node, status)
|
||||
RF_DagNode_t *node;
|
||||
int status;
|
||||
rf_GenericWakeupFunc(RF_DagNode_t *node, int status)
|
||||
{
|
||||
|
||||
switch (node->status) {
|
||||
case rf_bwd1:
|
||||
node->status = rf_bwd2;
|
||||
@ -478,8 +461,7 @@ rf_GenericWakeupFunc(node, status)
|
||||
* SU, and use the pda params to determine where within the buffer to
|
||||
* XOR the input buffers. */
|
||||
int
|
||||
rf_RegularXorFunc(node)
|
||||
RF_DagNode_t *node;
|
||||
rf_RegularXorFunc(RF_DagNode_t *node)
|
||||
{
|
||||
RF_Raid_t *raidPtr = (RF_Raid_t *) node->params[node->numParams - 1].p;
|
||||
RF_AccTraceEntry_t *tracerec = node->dagHdr->tracerec;
|
||||
@ -505,8 +487,7 @@ rf_RegularXorFunc(node)
|
||||
}
|
||||
/* xor the inputs into the result buffer, ignoring placement issues */
|
||||
int
|
||||
rf_SimpleXorFunc(node)
|
||||
RF_DagNode_t *node;
|
||||
rf_SimpleXorFunc(RF_DagNode_t *node)
|
||||
{
|
||||
RF_Raid_t *raidPtr = (RF_Raid_t *) node->params[node->numParams - 1].p;
|
||||
int i, retcode = 0;
|
||||
@ -538,8 +519,7 @@ rf_SimpleXorFunc(node)
|
||||
* parameter list to determine where within the target buffer the
|
||||
* corresponding data should be xored. */
|
||||
int
|
||||
rf_RecoveryXorFunc(node)
|
||||
RF_DagNode_t *node;
|
||||
rf_RecoveryXorFunc(RF_DagNode_t *node)
|
||||
{
|
||||
RF_Raid_t *raidPtr = (RF_Raid_t *) node->params[node->numParams - 1].p;
|
||||
RF_RaidLayout_t *layoutPtr = (RF_RaidLayout_t *) & raidPtr->Layout;
|
||||
@ -583,12 +563,8 @@ rf_RecoveryXorFunc(node)
|
||||
* the portion of targbuf identified in the pda. */
|
||||
|
||||
int
|
||||
rf_XorIntoBuffer(raidPtr, pda, srcbuf, targbuf, bp)
|
||||
RF_Raid_t *raidPtr;
|
||||
RF_PhysDiskAddr_t *pda;
|
||||
char *srcbuf;
|
||||
char *targbuf;
|
||||
void *bp;
|
||||
rf_XorIntoBuffer(RF_Raid_t *raidPtr, RF_PhysDiskAddr_t *pda,
|
||||
char *srcbuf, char *targbuf, void *bp)
|
||||
{
|
||||
char *targptr;
|
||||
int sectPerSU = raidPtr->Layout.sectorsPerStripeUnit;
|
||||
@ -608,11 +584,7 @@ rf_XorIntoBuffer(raidPtr, pda, srcbuf, targbuf, bp)
|
||||
* a multiple of the sector size, so there should be no problem with
|
||||
* leftover bytes at the end. */
|
||||
int
|
||||
rf_bxor(src, dest, len, bp)
|
||||
char *src;
|
||||
char *dest;
|
||||
int len;
|
||||
void *bp;
|
||||
rf_bxor(char *src, char *dest, int len, void *bp)
|
||||
{
|
||||
unsigned mask = sizeof(long) - 1, retcode = 0;
|
||||
|
||||
@ -634,13 +606,12 @@ rf_bxor(src, dest, len, bp)
|
||||
* about which input buffers are in kernel/user space, nor about their
|
||||
* alignment, so in each loop we compute the maximum number of bytes
|
||||
* that we can xor without crossing any page boundaries, and do only
|
||||
* this many bytes before the next remap. */
|
||||
* this many bytes before the next remap.
|
||||
*
|
||||
* len - is in longwords
|
||||
*/
|
||||
int
|
||||
rf_longword_bxor(src, dest, len, bp)
|
||||
unsigned long *src;
|
||||
unsigned long *dest;
|
||||
int len; /* longwords */
|
||||
void *bp;
|
||||
rf_longword_bxor(unsigned long *src, unsigned long *dest, int len, void *bp)
|
||||
{
|
||||
unsigned long *end = src + len;
|
||||
unsigned long d0, d1, d2, d3, s0, s1, s2, s3; /* temps */
|
||||
@ -710,15 +681,11 @@ rf_longword_bxor(src, dest, len, bp)
|
||||
dst = a ^ b ^ c;
|
||||
a may equal dst
|
||||
see comment above longword_bxor
|
||||
len is length in longwords
|
||||
*/
|
||||
int
|
||||
rf_longword_bxor3(dst, a, b, c, len, bp)
|
||||
unsigned long *dst;
|
||||
unsigned long *a;
|
||||
unsigned long *b;
|
||||
unsigned long *c;
|
||||
int len; /* length in longwords */
|
||||
void *bp;
|
||||
rf_longword_bxor3(unsigned long *dst, unsigned long *a, unsigned long *b,
|
||||
unsigned long *c, int len, void *bp)
|
||||
{
|
||||
unsigned long a0, a1, a2, a3, b0, b1, b2, b3;
|
||||
unsigned long *pg_a, *pg_b, *pg_c, *pg_dst; /* per-page source/dest
|
||||
@ -877,13 +844,8 @@ rf_longword_bxor3(dst, a, b, c, len, bp)
|
||||
}
|
||||
|
||||
int
|
||||
rf_bxor3(dst, a, b, c, len, bp)
|
||||
unsigned char *dst;
|
||||
unsigned char *a;
|
||||
unsigned char *b;
|
||||
unsigned char *c;
|
||||
unsigned long len;
|
||||
void *bp;
|
||||
rf_bxor3(unsigned char *dst, unsigned char *a, unsigned char *b,
|
||||
unsigned char *c, unsigned long len, void *bp)
|
||||
{
|
||||
RF_ASSERT(((RF_UL(dst) | RF_UL(a) | RF_UL(b) | RF_UL(c) | len) & 0x7) == 0);
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: rf_dagutils.c,v 1.22 2003/12/29 03:33:47 oster Exp $ */
|
||||
/* $NetBSD: rf_dagutils.c,v 1.23 2003/12/30 21:59:03 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.22 2003/12/29 03:33:47 oster Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: rf_dagutils.c,v 1.23 2003/12/30 21:59:03 oster Exp $");
|
||||
|
||||
#include <dev/raidframe/raidframevar.h>
|
||||
|
||||
@ -75,20 +75,12 @@ static void rf_ValidateVisitedBits(RF_DagHeader_t *);
|
||||
*
|
||||
*****************************************************************************/
|
||||
void
|
||||
rf_InitNode(
|
||||
RF_DagNode_t * node,
|
||||
RF_NodeStatus_t initstatus,
|
||||
int commit,
|
||||
int (*doFunc) (RF_DagNode_t * node),
|
||||
int (*undoFunc) (RF_DagNode_t * node),
|
||||
int (*wakeFunc) (RF_DagNode_t * node, int status),
|
||||
int nSucc,
|
||||
int nAnte,
|
||||
int nParam,
|
||||
int nResult,
|
||||
RF_DagHeader_t * hdr,
|
||||
char *name,
|
||||
RF_AllocListElem_t * alist)
|
||||
rf_InitNode(RF_DagNode_t *node, RF_NodeStatus_t initstatus, int commit,
|
||||
int (*doFunc) (RF_DagNode_t *node),
|
||||
int (*undoFunc) (RF_DagNode_t *node),
|
||||
int (*wakeFunc) (RF_DagNode_t *node, int status),
|
||||
int nSucc, int nAnte, int nParam, int nResult,
|
||||
RF_DagHeader_t *hdr, char *name, RF_AllocListElem_t *alist)
|
||||
{
|
||||
void **ptrs;
|
||||
int nptrs;
|
||||
@ -157,8 +149,7 @@ rf_InitNode(
|
||||
*****************************************************************************/
|
||||
|
||||
void
|
||||
rf_FreeDAG(dag_h)
|
||||
RF_DagHeader_t *dag_h;
|
||||
rf_FreeDAG(RF_DagHeader_t *dag_h)
|
||||
{
|
||||
RF_AccessStripeMapHeader_t *asmap, *t_asmap;
|
||||
RF_DagHeader_t *nextDag;
|
||||
@ -183,15 +174,13 @@ static struct pool rf_dagh_pool;
|
||||
|
||||
static void rf_ShutdownDAGs(void *);
|
||||
static void
|
||||
rf_ShutdownDAGs(ignored)
|
||||
void *ignored;
|
||||
rf_ShutdownDAGs(void *ignored)
|
||||
{
|
||||
pool_destroy(&rf_dagh_pool);
|
||||
}
|
||||
|
||||
int
|
||||
rf_ConfigureDAGs(listp)
|
||||
RF_ShutdownList_t **listp;
|
||||
rf_ConfigureDAGs(RF_ShutdownList_t **listp)
|
||||
{
|
||||
int rc;
|
||||
|
||||
@ -227,11 +216,8 @@ rf_FreeDAGHeader(RF_DagHeader_t * dh)
|
||||
}
|
||||
/* allocates a buffer big enough to hold the data described by pda */
|
||||
void *
|
||||
rf_AllocBuffer(
|
||||
RF_Raid_t * raidPtr,
|
||||
RF_DagHeader_t * dag_h,
|
||||
RF_PhysDiskAddr_t * pda,
|
||||
RF_AllocListElem_t * allocList)
|
||||
rf_AllocBuffer(RF_Raid_t *raidPtr, RF_DagHeader_t *dag_h,
|
||||
RF_PhysDiskAddr_t *pda, RF_AllocListElem_t *allocList)
|
||||
{
|
||||
char *p;
|
||||
|
||||
@ -247,7 +233,7 @@ rf_AllocBuffer(
|
||||
*****************************************************************************/
|
||||
|
||||
char *
|
||||
rf_NodeStatusString(RF_DagNode_t * node)
|
||||
rf_NodeStatusString(RF_DagNode_t *node)
|
||||
{
|
||||
switch (node->status) {
|
||||
case rf_wait:return ("wait");
|
||||
@ -263,7 +249,7 @@ rf_NodeStatusString(RF_DagNode_t * node)
|
||||
}
|
||||
|
||||
void
|
||||
rf_PrintNodeInfoString(RF_DagNode_t * node)
|
||||
rf_PrintNodeInfoString(RF_DagNode_t *node)
|
||||
{
|
||||
RF_PhysDiskAddr_t *pda;
|
||||
int (*df) (RF_DagNode_t *) = node->doFunc;
|
||||
@ -325,10 +311,7 @@ rf_PrintNodeInfoString(RF_DagNode_t * node)
|
||||
}
|
||||
#ifdef DEBUG
|
||||
static void
|
||||
rf_RecurPrintDAG(node, depth, unvisited)
|
||||
RF_DagNode_t *node;
|
||||
int depth;
|
||||
int unvisited;
|
||||
rf_RecurPrintDAG(RF_DagNode_t *node, int depth, int unvisited)
|
||||
{
|
||||
char *anttype;
|
||||
int i;
|
||||
@ -372,8 +355,7 @@ rf_RecurPrintDAG(node, depth, unvisited)
|
||||
}
|
||||
|
||||
static void
|
||||
rf_PrintDAG(dag_h)
|
||||
RF_DagHeader_t *dag_h;
|
||||
rf_PrintDAG(RF_DagHeader_t *dag_h)
|
||||
{
|
||||
int unvisited, i;
|
||||
char *status;
|
||||
@ -432,10 +414,7 @@ rf_AssignNodeNums(RF_DagHeader_t * dag_h)
|
||||
}
|
||||
|
||||
int
|
||||
rf_RecurAssignNodeNums(node, num, unvisited)
|
||||
RF_DagNode_t *node;
|
||||
int num;
|
||||
int unvisited;
|
||||
rf_RecurAssignNodeNums(RF_DagNode_t *node, int num, int unvisited)
|
||||
{
|
||||
int i;
|
||||
|
||||
@ -451,9 +430,7 @@ rf_RecurAssignNodeNums(node, num, unvisited)
|
||||
}
|
||||
/* set the header pointers in each node to "newptr" */
|
||||
void
|
||||
rf_ResetDAGHeaderPointers(dag_h, newptr)
|
||||
RF_DagHeader_t *dag_h;
|
||||
RF_DagHeader_t *newptr;
|
||||
rf_ResetDAGHeaderPointers(RF_DagHeader_t *dag_h, RF_DagHeader_t *newptr)
|
||||
{
|
||||
int i;
|
||||
for (i = 0; i < dag_h->numSuccedents; i++)
|
||||
@ -462,9 +439,7 @@ rf_ResetDAGHeaderPointers(dag_h, newptr)
|
||||
}
|
||||
|
||||
void
|
||||
rf_RecurResetDAGHeaderPointers(node, newptr)
|
||||
RF_DagNode_t *node;
|
||||
RF_DagHeader_t *newptr;
|
||||
rf_RecurResetDAGHeaderPointers(RF_DagNode_t *node, RF_DagHeader_t *newptr)
|
||||
{
|
||||
int i;
|
||||
node->dagHdr = newptr;
|
||||
@ -487,12 +462,8 @@ rf_PrintDAGList(RF_DagHeader_t * dag_h)
|
||||
}
|
||||
|
||||
static int
|
||||
rf_ValidateBranch(node, scount, acount, nodes, unvisited)
|
||||
RF_DagNode_t *node;
|
||||
int *scount;
|
||||
int *acount;
|
||||
RF_DagNode_t **nodes;
|
||||
int unvisited;
|
||||
rf_ValidateBranch(RF_DagNode_t *node, int *scount, int *acount,
|
||||
RF_DagNode_t **nodes, int unvisited)
|
||||
{
|
||||
int i, retcode = 0;
|
||||
|
||||
@ -549,10 +520,7 @@ rf_ValidateBranch(node, scount, acount, nodes, unvisited)
|
||||
}
|
||||
|
||||
static void
|
||||
rf_ValidateBranchVisitedBits(node, unvisited, rl)
|
||||
RF_DagNode_t *node;
|
||||
int unvisited;
|
||||
int rl;
|
||||
rf_ValidateBranchVisitedBits(RF_DagNode_t *node, int unvisited, int rl)
|
||||
{
|
||||
int i;
|
||||
|
||||
@ -569,8 +537,7 @@ rf_ValidateBranchVisitedBits(node, unvisited, rl)
|
||||
* in execution time
|
||||
*/
|
||||
static void
|
||||
rf_ValidateVisitedBits(dag)
|
||||
RF_DagHeader_t *dag;
|
||||
rf_ValidateVisitedBits(RF_DagHeader_t *dag)
|
||||
{
|
||||
int i, unvisited;
|
||||
|
||||
@ -601,8 +568,7 @@ rf_ValidateVisitedBits(dag)
|
||||
* -- what else?
|
||||
*/
|
||||
int
|
||||
rf_ValidateDAG(dag_h)
|
||||
RF_DagHeader_t *dag_h;
|
||||
rf_ValidateDAG(RF_DagHeader_t *dag_h)
|
||||
{
|
||||
int i, nodecount;
|
||||
int *scount, *acount;/* per-node successor and antecedent counts */
|
||||
@ -710,9 +676,7 @@ validate_dag_bad:
|
||||
*****************************************************************************/
|
||||
|
||||
void
|
||||
rf_redirect_asm(
|
||||
RF_Raid_t * raidPtr,
|
||||
RF_AccessStripeMap_t * asmap)
|
||||
rf_redirect_asm(RF_Raid_t *raidPtr, RF_AccessStripeMap_t *asmap)
|
||||
{
|
||||
int ds = (raidPtr->Layout.map->flags & RF_DISTRIBUTE_SPARE) ? 1 : 0;
|
||||
int fcol = raidPtr->reconControl->fcol;
|
||||
@ -761,20 +725,23 @@ rf_redirect_asm(
|
||||
* Note that this routine does the wrong thing if the access is fully
|
||||
* contained within one stripe unit, so we RF_ASSERT against this case at the
|
||||
* start.
|
||||
*
|
||||
* layoutPtr - in: layout information
|
||||
* asmap - in: access stripe map
|
||||
* dag_h - in: header of the dag to create
|
||||
* new_asm_h - in: ptr to array of 2 headers. to be filled in
|
||||
* nRodNodes - out: num nodes to be generated to read unaccessed data
|
||||
* sosBuffer, eosBuffer - out: pointers to newly allocated buffer
|
||||
*/
|
||||
void
|
||||
rf_MapUnaccessedPortionOfStripe(
|
||||
RF_Raid_t * raidPtr,
|
||||
RF_RaidLayout_t * layoutPtr,/* in: layout information */
|
||||
RF_AccessStripeMap_t * asmap, /* in: access stripe map */
|
||||
RF_DagHeader_t * dag_h, /* in: header of the dag to create */
|
||||
RF_AccessStripeMapHeader_t ** new_asm_h, /* in: ptr to array of 2
|
||||
* headers, to be filled in */
|
||||
int *nRodNodes, /* out: num nodes to be generated to read
|
||||
* unaccessed data */
|
||||
char **sosBuffer, /* out: pointers to newly allocated buffer */
|
||||
char **eosBuffer,
|
||||
RF_AllocListElem_t * allocList)
|
||||
rf_MapUnaccessedPortionOfStripe(RF_Raid_t *raidPtr,
|
||||
RF_RaidLayout_t *layoutPtr,
|
||||
RF_AccessStripeMap_t *asmap,
|
||||
RF_DagHeader_t *dag_h,
|
||||
RF_AccessStripeMapHeader_t **new_asm_h,
|
||||
int *nRodNodes,
|
||||
char **sosBuffer, char **eosBuffer,
|
||||
RF_AllocListElem_t *allocList)
|
||||
{
|
||||
RF_RaidAddr_t sosRaidAddress, eosRaidAddress;
|
||||
RF_SectorNum_t sosNumSector, eosNumSector;
|
||||
@ -820,10 +787,8 @@ rf_MapUnaccessedPortionOfStripe(
|
||||
|
||||
/* returns non-zero if the indicated ranges of stripe unit offsets overlap */
|
||||
int
|
||||
rf_PDAOverlap(
|
||||
RF_RaidLayout_t * layoutPtr,
|
||||
RF_PhysDiskAddr_t * src,
|
||||
RF_PhysDiskAddr_t * dest)
|
||||
rf_PDAOverlap(RF_RaidLayout_t *layoutPtr,
|
||||
RF_PhysDiskAddr_t *src, RF_PhysDiskAddr_t *dest)
|
||||
{
|
||||
RF_SectorNum_t soffs = rf_StripeUnitOffset(layoutPtr, src->startSector);
|
||||
RF_SectorNum_t doffs = rf_StripeUnitOffset(layoutPtr, dest->startSector);
|
||||
@ -863,16 +828,13 @@ rf_PDAOverlap(
|
||||
/* out: nXorBufs - the total number of xor bufs required */
|
||||
/* out: rpBufPtr - a buffer for the parity read */
|
||||
void
|
||||
rf_GenerateFailedAccessASMs(
|
||||
RF_Raid_t * raidPtr,
|
||||
RF_AccessStripeMap_t * asmap,
|
||||
RF_PhysDiskAddr_t * failedPDA,
|
||||
RF_DagHeader_t * dag_h,
|
||||
RF_AccessStripeMapHeader_t ** new_asm_h,
|
||||
int *nXorBufs,
|
||||
char **rpBufPtr,
|
||||
char *overlappingPDAs,
|
||||
RF_AllocListElem_t * allocList)
|
||||
rf_GenerateFailedAccessASMs(RF_Raid_t *raidPtr, RF_AccessStripeMap_t *asmap,
|
||||
RF_PhysDiskAddr_t *failedPDA,
|
||||
RF_DagHeader_t *dag_h,
|
||||
RF_AccessStripeMapHeader_t **new_asm_h,
|
||||
int *nXorBufs, char **rpBufPtr,
|
||||
char *overlappingPDAs,
|
||||
RF_AllocListElem_t *allocList)
|
||||
{
|
||||
RF_RaidLayout_t *layoutPtr = &(raidPtr->Layout);
|
||||
|
||||
@ -1014,12 +976,8 @@ rf_GenerateFailedAccessASMs(
|
||||
*
|
||||
*/
|
||||
void
|
||||
rf_RangeRestrictPDA(
|
||||
RF_Raid_t * raidPtr,
|
||||
RF_PhysDiskAddr_t * src,
|
||||
RF_PhysDiskAddr_t * dest,
|
||||
int dobuffer,
|
||||
int doraidaddr)
|
||||
rf_RangeRestrictPDA(RF_Raid_t *raidPtr, RF_PhysDiskAddr_t *src,
|
||||
RF_PhysDiskAddr_t *dest, int dobuffer, int doraidaddr)
|
||||
{
|
||||
RF_RaidLayout_t *layoutPtr = &raidPtr->Layout;
|
||||
RF_SectorNum_t soffs = rf_StripeUnitOffset(layoutPtr, src->startSector);
|
||||
@ -1057,9 +1015,7 @@ static int lowprimes[NLOWPRIMES] = {2, 3, 5, 7, 11, 13, 17, 19};
|
||||
* access is to primary
|
||||
*****************************************************************************/
|
||||
int
|
||||
rf_compute_workload_shift(
|
||||
RF_Raid_t * raidPtr,
|
||||
RF_PhysDiskAddr_t * pda)
|
||||
rf_compute_workload_shift(RF_Raid_t *raidPtr, RF_PhysDiskAddr_t *pda)
|
||||
{
|
||||
/*
|
||||
* variables:
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: rf_debugMem.c,v 1.13 2003/12/29 05:22:16 oster Exp $ */
|
||||
/* $NetBSD: rf_debugMem.c,v 1.14 2003/12/30 21:59:03 oster Exp $ */
|
||||
/*
|
||||
* Copyright (c) 1995 Carnegie-Mellon University.
|
||||
* All rights reserved.
|
||||
@ -32,7 +32,7 @@
|
||||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: rf_debugMem.c,v 1.13 2003/12/29 05:22:16 oster Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: rf_debugMem.c,v 1.14 2003/12/30 21:59:03 oster Exp $");
|
||||
|
||||
#include <dev/raidframe/raidframevar.h>
|
||||
|
||||
@ -64,10 +64,7 @@ static void memory_hash_insert(void *addr, int size, int line, char *filen);
|
||||
static int memory_hash_remove(void *addr, int sz);
|
||||
|
||||
void
|
||||
rf_record_malloc(p, size, line, filen)
|
||||
void *p;
|
||||
int size, line;
|
||||
char *filen;
|
||||
rf_record_malloc(void *p, int size, int line, char *filen)
|
||||
{
|
||||
RF_ASSERT(size != 0);
|
||||
|
||||
@ -81,9 +78,7 @@ rf_record_malloc(p, size, line, filen)
|
||||
}
|
||||
|
||||
void
|
||||
rf_unrecord_malloc(p, sz)
|
||||
void *p;
|
||||
int sz;
|
||||
rf_unrecord_malloc(void *p, int sz)
|
||||
{
|
||||
int size;
|
||||
|
||||
@ -120,8 +115,7 @@ rf_print_unfreed()
|
||||
#endif /* RF_DEBUG_MEM */
|
||||
|
||||
int
|
||||
rf_ConfigureDebugMem(listp)
|
||||
RF_ShutdownList_t **listp;
|
||||
rf_ConfigureDebugMem(RF_ShutdownList_t **listp)
|
||||
{
|
||||
#if RF_DEBUG_MEM
|
||||
int i, rc;
|
||||
@ -141,10 +135,7 @@ rf_ConfigureDebugMem(listp)
|
||||
#define HASHADDR(_a_) ( (((unsigned long) _a_)>>3) % RF_MH_TABLESIZE )
|
||||
|
||||
static void
|
||||
memory_hash_insert(addr, size, line, filen)
|
||||
void *addr;
|
||||
int size, line;
|
||||
char *filen;
|
||||
memory_hash_insert(void *addr, int size, int line, char *filen)
|
||||
{
|
||||
unsigned long bucket = HASHADDR(addr);
|
||||
struct mh_struct *p;
|
||||
@ -173,9 +164,7 @@ memory_hash_insert(addr, size, line, filen)
|
||||
}
|
||||
|
||||
static int
|
||||
memory_hash_remove(addr, sz)
|
||||
void *addr;
|
||||
int sz;
|
||||
memory_hash_remove(void *addr, int sz)
|
||||
{
|
||||
unsigned long bucket = HASHADDR(addr);
|
||||
struct mh_struct *p;
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: rf_debugprint.c,v 1.6 2002/08/04 03:22:07 oster Exp $ */
|
||||
/* $NetBSD: rf_debugprint.c,v 1.7 2003/12/30 21:59:03 oster Exp $ */
|
||||
/*
|
||||
* Copyright (c) 1995 Carnegie-Mellon University.
|
||||
* All rights reserved.
|
||||
@ -34,7 +34,7 @@
|
||||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: rf_debugprint.c,v 1.6 2002/08/04 03:22:07 oster Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: rf_debugprint.c,v 1.7 2003/12/30 21:59:03 oster Exp $");
|
||||
|
||||
#include <dev/raidframe/raidframevar.h>
|
||||
|
||||
@ -46,9 +46,8 @@ __KERNEL_RCSID(0, "$NetBSD: rf_debugprint.c,v 1.6 2002/08/04 03:22:07 oster Exp
|
||||
#include <sys/param.h>
|
||||
|
||||
void
|
||||
rf_debug_printf(s, a1, a2, a3, a4, a5, a6, a7, a8)
|
||||
char *s;
|
||||
void *a1, *a2, *a3, *a4, *a5, *a6, *a7, *a8;
|
||||
rf_debug_printf(char *s, void *a1, void *a2, void *a3, void *a4,
|
||||
void *a5, void *a6, void *a7, void *a8)
|
||||
{
|
||||
printf(s, a1, a2, a3, a4, a5, a6, a7, a8);
|
||||
}
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: rf_decluster.c,v 1.14 2002/11/19 01:49:42 oster Exp $ */
|
||||
/* $NetBSD: rf_decluster.c,v 1.15 2003/12/30 21:59:03 oster Exp $ */
|
||||
/*
|
||||
* Copyright (c) 1995 Carnegie-Mellon University.
|
||||
* All rights reserved.
|
||||
@ -48,7 +48,7 @@
|
||||
*--------------------------------------------------------------------*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: rf_decluster.c,v 1.14 2002/11/19 01:49:42 oster Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: rf_decluster.c,v 1.15 2003/12/30 21:59:03 oster Exp $");
|
||||
|
||||
#include <dev/raidframe/raidframevar.h>
|
||||
|
||||
@ -67,10 +67,8 @@ __KERNEL_RCSID(0, "$NetBSD: rf_decluster.c,v 1.14 2002/11/19 01:49:42 oster Exp
|
||||
/* configuration code */
|
||||
|
||||
int
|
||||
rf_ConfigureDeclustered(
|
||||
RF_ShutdownList_t ** listp,
|
||||
RF_Raid_t * raidPtr,
|
||||
RF_Config_t * cfgPtr)
|
||||
rf_ConfigureDeclustered(RF_ShutdownList_t **listp, RF_Raid_t *raidPtr,
|
||||
RF_Config_t *cfgPtr)
|
||||
{
|
||||
RF_RaidLayout_t *layoutPtr = &(raidPtr->Layout);
|
||||
int b, v, k, r, lambda; /* block design params */
|
||||
@ -290,8 +288,7 @@ rf_ConfigureDeclustered(
|
||||
/* declustering with distributed sparing */
|
||||
static void rf_ShutdownDeclusteredDS(RF_ThreadArg_t);
|
||||
static void
|
||||
rf_ShutdownDeclusteredDS(arg)
|
||||
RF_ThreadArg_t arg;
|
||||
rf_ShutdownDeclusteredDS(RF_ThreadArg_t arg)
|
||||
{
|
||||
RF_DeclusteredConfigInfo_t *info;
|
||||
RF_Raid_t *raidPtr;
|
||||
@ -303,10 +300,8 @@ rf_ShutdownDeclusteredDS(arg)
|
||||
}
|
||||
|
||||
int
|
||||
rf_ConfigureDeclusteredDS(
|
||||
RF_ShutdownList_t ** listp,
|
||||
RF_Raid_t * raidPtr,
|
||||
RF_Config_t * cfgPtr)
|
||||
rf_ConfigureDeclusteredDS(RF_ShutdownList_t **listp, RF_Raid_t *raidPtr,
|
||||
RF_Config_t *cfgPtr)
|
||||
{
|
||||
int rc;
|
||||
|
||||
@ -323,13 +318,9 @@ rf_ConfigureDeclusteredDS(
|
||||
}
|
||||
|
||||
void
|
||||
rf_MapSectorDeclustered(raidPtr, raidSector, row, col, diskSector, remap)
|
||||
RF_Raid_t *raidPtr;
|
||||
RF_RaidAddr_t raidSector;
|
||||
RF_RowCol_t *row;
|
||||
RF_RowCol_t *col;
|
||||
RF_SectorNum_t *diskSector;
|
||||
int remap;
|
||||
rf_MapSectorDeclustered(RF_Raid_t *raidPtr, RF_RaidAddr_t raidSector,
|
||||
RF_RowCol_t *row, RF_RowCol_t *col,
|
||||
RF_SectorNum_t *diskSector, int remap)
|
||||
{
|
||||
RF_RaidLayout_t *layoutPtr = &(raidPtr->Layout);
|
||||
RF_DeclusteredConfigInfo_t *info = (RF_DeclusteredConfigInfo_t *) layoutPtr->layoutSpecificInfo;
|
||||
@ -392,13 +383,9 @@ rf_MapSectorDeclustered(raidPtr, raidSector, row, col, diskSector, remap)
|
||||
|
||||
/* prototyping this inexplicably causes the compile of the layout table (rf_layout.c) to fail */
|
||||
void
|
||||
rf_MapParityDeclustered(
|
||||
RF_Raid_t * raidPtr,
|
||||
RF_RaidAddr_t raidSector,
|
||||
RF_RowCol_t * row,
|
||||
RF_RowCol_t * col,
|
||||
RF_SectorNum_t * diskSector,
|
||||
int remap)
|
||||
rf_MapParityDeclustered(RF_Raid_t *raidPtr, RF_RaidAddr_t raidSector,
|
||||
RF_RowCol_t *row, RF_RowCol_t *col,
|
||||
RF_SectorNum_t *diskSector, int remap)
|
||||
{
|
||||
RF_RaidLayout_t *layoutPtr = &(raidPtr->Layout);
|
||||
RF_DeclusteredConfigInfo_t *info = (RF_DeclusteredConfigInfo_t *) layoutPtr->layoutSpecificInfo;
|
||||
@ -464,11 +451,8 @@ rf_MapParityDeclustered(
|
||||
* the caller must _never_ attempt to modify this array.
|
||||
*/
|
||||
void
|
||||
rf_IdentifyStripeDeclustered(
|
||||
RF_Raid_t * raidPtr,
|
||||
RF_RaidAddr_t addr,
|
||||
RF_RowCol_t ** diskids,
|
||||
RF_RowCol_t * outRow)
|
||||
rf_IdentifyStripeDeclustered(RF_Raid_t *raidPtr, RF_RaidAddr_t addr,
|
||||
RF_RowCol_t **diskids, RF_RowCol_t *outRow)
|
||||
{
|
||||
RF_RaidLayout_t *layoutPtr = &(raidPtr->Layout);
|
||||
RF_DeclusteredConfigInfo_t *info = (RF_DeclusteredConfigInfo_t *) layoutPtr->layoutSpecificInfo;
|
||||
@ -513,8 +497,7 @@ rf_IdentifyStripeDeclustered(
|
||||
* because multiple bufs will be required for each stripe under recon.
|
||||
*/
|
||||
RF_HeadSepLimit_t
|
||||
rf_GetDefaultHeadSepLimitDeclustered(
|
||||
RF_Raid_t * raidPtr)
|
||||
rf_GetDefaultHeadSepLimitDeclustered(RF_Raid_t *raidPtr)
|
||||
{
|
||||
RF_DeclusteredConfigInfo_t *info = (RF_DeclusteredConfigInfo_t *) raidPtr->Layout.layoutSpecificInfo;
|
||||
|
||||
@ -547,12 +530,11 @@ rf_GetDefaultNumFloatingReconBuffersDeclustered(RF_Raid_t * raidPtr)
|
||||
* an offset into the last fulltable.
|
||||
*/
|
||||
void
|
||||
rf_decluster_adjust_params(
|
||||
RF_RaidLayout_t * layoutPtr,
|
||||
RF_StripeNum_t * SUID,
|
||||
RF_StripeCount_t * sus_per_fulltable,
|
||||
RF_StripeCount_t * fulltable_depth,
|
||||
RF_StripeNum_t * base_suid)
|
||||
rf_decluster_adjust_params(RF_RaidLayout_t *layoutPtr,
|
||||
RF_StripeNum_t *SUID,
|
||||
RF_StripeCount_t *sus_per_fulltable,
|
||||
RF_StripeCount_t *fulltable_depth,
|
||||
RF_StripeNum_t *base_suid)
|
||||
{
|
||||
RF_DeclusteredConfigInfo_t *info = (RF_DeclusteredConfigInfo_t *) layoutPtr->layoutSpecificInfo;
|
||||
|
||||
@ -576,11 +558,10 @@ rf_decluster_adjust_params(
|
||||
* See comment above RaidAddressToParityStripeID in layout.c.
|
||||
*/
|
||||
void
|
||||
rf_MapSIDToPSIDDeclustered(
|
||||
RF_RaidLayout_t * layoutPtr,
|
||||
RF_StripeNum_t stripeID,
|
||||
RF_StripeNum_t * psID,
|
||||
RF_ReconUnitNum_t * which_ru)
|
||||
rf_MapSIDToPSIDDeclustered(RF_RaidLayout_t *layoutPtr,
|
||||
RF_StripeNum_t stripeID,
|
||||
RF_StripeNum_t *psID,
|
||||
RF_ReconUnitNum_t *which_ru)
|
||||
{
|
||||
RF_DeclusteredConfigInfo_t *info;
|
||||
|
||||
@ -597,17 +578,16 @@ rf_MapSIDToPSIDDeclustered(
|
||||
* Modifies the "col" and "outSU" parameters only.
|
||||
*/
|
||||
void
|
||||
rf_remap_to_spare_space(
|
||||
RF_RaidLayout_t * layoutPtr,
|
||||
RF_DeclusteredConfigInfo_t * info,
|
||||
RF_RowCol_t row,
|
||||
RF_StripeNum_t FullTableID,
|
||||
RF_StripeNum_t TableID,
|
||||
RF_SectorNum_t BlockID,
|
||||
RF_StripeNum_t base_suid,
|
||||
RF_StripeNum_t SpareRegion,
|
||||
RF_RowCol_t * outCol,
|
||||
RF_StripeNum_t * outSU)
|
||||
rf_remap_to_spare_space(RF_RaidLayout_t *layoutPtr,
|
||||
RF_DeclusteredConfigInfo_t *info,
|
||||
RF_RowCol_t row,
|
||||
RF_StripeNum_t FullTableID,
|
||||
RF_StripeNum_t TableID,
|
||||
RF_SectorNum_t BlockID,
|
||||
RF_StripeNum_t base_suid,
|
||||
RF_StripeNum_t SpareRegion,
|
||||
RF_RowCol_t *outCol,
|
||||
RF_StripeNum_t *outSU)
|
||||
{
|
||||
RF_StripeNum_t ftID, spareTableStartSU, TableInSpareRegion, lastSROffset,
|
||||
which_ft;
|
||||
@ -649,10 +629,7 @@ rf_remap_to_spare_space(
|
||||
|
||||
#if (RF_INCLUDE_PARITY_DECLUSTERING_DS > 0)
|
||||
int
|
||||
rf_InstallSpareTable(
|
||||
RF_Raid_t * raidPtr,
|
||||
RF_RowCol_t frow,
|
||||
RF_RowCol_t fcol)
|
||||
rf_InstallSpareTable(RF_Raid_t *raidPtr, RF_RowCol_t frow, RF_RowCol_t fcol)
|
||||
{
|
||||
RF_DeclusteredConfigInfo_t *info = (RF_DeclusteredConfigInfo_t *) raidPtr->Layout.layoutSpecificInfo;
|
||||
RF_SparetWait_t *req;
|
||||
@ -679,9 +656,7 @@ rf_InstallSpareTable(
|
||||
* Invoked via ioctl to install a spare table in the kernel.
|
||||
*/
|
||||
int
|
||||
rf_SetSpareTable(raidPtr, data)
|
||||
RF_Raid_t *raidPtr;
|
||||
void *data;
|
||||
rf_SetSpareTable(RF_Raid_t *raidPtr, void *data)
|
||||
{
|
||||
RF_DeclusteredConfigInfo_t *info = (RF_DeclusteredConfigInfo_t *) raidPtr->Layout.layoutSpecificInfo;
|
||||
RF_SpareTableEntry_t **ptrs;
|
||||
@ -717,8 +692,7 @@ rf_SetSpareTable(raidPtr, data)
|
||||
}
|
||||
|
||||
RF_ReconUnitCount_t
|
||||
rf_GetNumSpareRUsDeclustered(raidPtr)
|
||||
RF_Raid_t *raidPtr;
|
||||
rf_GetNumSpareRUsDeclustered(RF_Raid_t *raidPtr)
|
||||
{
|
||||
RF_RaidLayout_t *layoutPtr = &raidPtr->Layout;
|
||||
|
||||
@ -727,8 +701,7 @@ rf_GetNumSpareRUsDeclustered(raidPtr)
|
||||
#endif /* (RF_INCLUDE_PARITY_DECLUSTERING > 0) || (RF_INCLUDE_PARITY_DECLUSTERING_PQ > 0) */
|
||||
|
||||
void
|
||||
rf_FreeSpareTable(raidPtr)
|
||||
RF_Raid_t *raidPtr;
|
||||
rf_FreeSpareTable(RF_Raid_t *raidPtr)
|
||||
{
|
||||
long i;
|
||||
RF_RaidLayout_t *layoutPtr = &raidPtr->Layout;
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: rf_declusterPQ.c,v 1.9 2003/12/29 02:38:17 oster Exp $ */
|
||||
/* $NetBSD: rf_declusterPQ.c,v 1.10 2003/12/30 21:59:03 oster Exp $ */
|
||||
/*
|
||||
* Copyright (c) 1995 Carnegie-Mellon University.
|
||||
* All rights reserved.
|
||||
@ -35,7 +35,7 @@
|
||||
*--------------------------------------------------*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: rf_declusterPQ.c,v 1.9 2003/12/29 02:38:17 oster Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: rf_declusterPQ.c,v 1.10 2003/12/30 21:59:03 oster Exp $");
|
||||
|
||||
#include <dev/raidframe/raidframevar.h>
|
||||
|
||||
@ -52,10 +52,8 @@ __KERNEL_RCSID(0, "$NetBSD: rf_declusterPQ.c,v 1.9 2003/12/29 02:38:17 oster Exp
|
||||
/* configuration code */
|
||||
|
||||
int
|
||||
rf_ConfigureDeclusteredPQ(
|
||||
RF_ShutdownList_t ** listp,
|
||||
RF_Raid_t * raidPtr,
|
||||
RF_Config_t * cfgPtr)
|
||||
rf_ConfigureDeclusteredPQ(RF_ShutdownList_t **listp, RF_Raid_t *raidPtr,
|
||||
RF_Config_t *cfgPtr)
|
||||
{
|
||||
RF_RaidLayout_t *layoutPtr = &(raidPtr->Layout);
|
||||
int b, v, k, r, lambda; /* block design params */
|
||||
@ -268,7 +266,7 @@ rf_ConfigureDeclusteredPQ(
|
||||
}
|
||||
|
||||
int
|
||||
rf_GetDefaultNumFloatingReconBuffersPQ(RF_Raid_t * raidPtr)
|
||||
rf_GetDefaultNumFloatingReconBuffersPQ(RF_Raid_t *raidPtr)
|
||||
{
|
||||
int def_decl;
|
||||
|
||||
@ -277,13 +275,9 @@ rf_GetDefaultNumFloatingReconBuffersPQ(RF_Raid_t * raidPtr)
|
||||
}
|
||||
|
||||
void
|
||||
rf_MapSectorDeclusteredPQ(
|
||||
RF_Raid_t * raidPtr,
|
||||
RF_RaidAddr_t raidSector,
|
||||
RF_RowCol_t * row,
|
||||
RF_RowCol_t * col,
|
||||
RF_SectorNum_t * diskSector,
|
||||
int remap)
|
||||
rf_MapSectorDeclusteredPQ(RF_Raid_t *raidPtr, RF_RaidAddr_t raidSector,
|
||||
RF_RowCol_t *row, RF_RowCol_t *col,
|
||||
RF_SectorNum_t *diskSector, int remap)
|
||||
{
|
||||
RF_RaidLayout_t *layoutPtr = &(raidPtr->Layout);
|
||||
RF_DeclusteredConfigInfo_t *info = (RF_DeclusteredConfigInfo_t *) layoutPtr->layoutSpecificInfo;
|
||||
@ -349,13 +343,9 @@ rf_MapSectorDeclusteredPQ(
|
||||
|
||||
|
||||
void
|
||||
rf_MapParityDeclusteredPQ(
|
||||
RF_Raid_t * raidPtr,
|
||||
RF_RaidAddr_t raidSector,
|
||||
RF_RowCol_t * row,
|
||||
RF_RowCol_t * col,
|
||||
RF_SectorNum_t * diskSector,
|
||||
int remap)
|
||||
rf_MapParityDeclusteredPQ(RF_Raid_t *raidPtr, RF_RaidAddr_t raidSector,
|
||||
RF_RowCol_t *row, RF_RowCol_t *col,
|
||||
RF_SectorNum_t *diskSector, int remap)
|
||||
{
|
||||
RF_RaidLayout_t *layoutPtr = &(raidPtr->Layout);
|
||||
RF_DeclusteredConfigInfo_t *info = (RF_DeclusteredConfigInfo_t *) layoutPtr->layoutSpecificInfo;
|
||||
@ -405,13 +395,9 @@ rf_MapParityDeclusteredPQ(
|
||||
}
|
||||
|
||||
void
|
||||
rf_MapQDeclusteredPQ(
|
||||
RF_Raid_t * raidPtr,
|
||||
RF_RaidAddr_t raidSector,
|
||||
RF_RowCol_t * row,
|
||||
RF_RowCol_t * col,
|
||||
RF_SectorNum_t * diskSector,
|
||||
int remap)
|
||||
rf_MapQDeclusteredPQ(RF_Raid_t *raidPtr, RF_RaidAddr_t raidSector,
|
||||
RF_RowCol_t *row, RF_RowCol_t *col,
|
||||
RF_SectorNum_t *diskSector, int remap)
|
||||
{
|
||||
RF_RaidLayout_t *layoutPtr = &(raidPtr->Layout);
|
||||
RF_DeclusteredConfigInfo_t *info = (RF_DeclusteredConfigInfo_t *) layoutPtr->layoutSpecificInfo;
|
||||
@ -464,11 +450,8 @@ rf_MapQDeclusteredPQ(
|
||||
* the caller must _never_ attempt to modify this array.
|
||||
*/
|
||||
void
|
||||
rf_IdentifyStripeDeclusteredPQ(
|
||||
RF_Raid_t * raidPtr,
|
||||
RF_RaidAddr_t addr,
|
||||
RF_RowCol_t ** diskids,
|
||||
RF_RowCol_t * outRow)
|
||||
rf_IdentifyStripeDeclusteredPQ(RF_Raid_t *raidPtr, RF_RaidAddr_t addr,
|
||||
RF_RowCol_t **diskids, RF_RowCol_t *outRow)
|
||||
{
|
||||
RF_RaidLayout_t *layoutPtr = &(raidPtr->Layout);
|
||||
RF_DeclusteredConfigInfo_t *info = (RF_DeclusteredConfigInfo_t *) layoutPtr->layoutSpecificInfo;
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: rf_diskqueue.c,v 1.26 2003/12/29 05:48:13 oster Exp $ */
|
||||
/* $NetBSD: rf_diskqueue.c,v 1.27 2003/12/30 21:59:03 oster 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.26 2003/12/29 05:48:13 oster Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: rf_diskqueue.c,v 1.27 2003/12/30 21:59:03 oster Exp $");
|
||||
|
||||
#include <dev/raidframe/raidframevar.h>
|
||||
|
||||
@ -157,8 +157,7 @@ static struct pool rf_dqd_pool;
|
||||
#include <sys/buf.h>
|
||||
|
||||
static int
|
||||
init_dqd(dqd)
|
||||
RF_DiskQueueData_t *dqd;
|
||||
init_dqd(RF_DiskQueueData_t *dqd)
|
||||
{
|
||||
|
||||
dqd->bp = (struct buf *) malloc(sizeof(struct buf),
|
||||
@ -172,24 +171,18 @@ init_dqd(dqd)
|
||||
}
|
||||
|
||||
static void
|
||||
clean_dqd(dqd)
|
||||
RF_DiskQueueData_t *dqd;
|
||||
clean_dqd(RF_DiskQueueData_t *dqd)
|
||||
{
|
||||
free(dqd->bp, M_RAIDFRAME);
|
||||
}
|
||||
/* configures a single disk queue */
|
||||
|
||||
int
|
||||
rf_ConfigureDiskQueue(
|
||||
RF_Raid_t * raidPtr,
|
||||
RF_DiskQueue_t * diskqueue,
|
||||
RF_RowCol_t c,
|
||||
const RF_DiskQueueSW_t * p,
|
||||
RF_SectorCount_t sectPerDisk,
|
||||
dev_t dev,
|
||||
int maxOutstanding,
|
||||
RF_ShutdownList_t ** listp,
|
||||
RF_AllocListElem_t * clList)
|
||||
rf_ConfigureDiskQueue(RF_Raid_t *raidPtr, RF_DiskQueue_t *diskqueue,
|
||||
RF_RowCol_t c, const RF_DiskQueueSW_t *p,
|
||||
RF_SectorCount_t sectPerDisk, dev_t dev,
|
||||
int maxOutstanding, RF_ShutdownList_t **listp,
|
||||
RF_AllocListElem_t *clList)
|
||||
{
|
||||
diskqueue->col = c;
|
||||
diskqueue->qPtr = p;
|
||||
@ -210,15 +203,13 @@ rf_ConfigureDiskQueue(
|
||||
}
|
||||
|
||||
static void
|
||||
rf_ShutdownDiskQueueSystem(ignored)
|
||||
void *ignored;
|
||||
rf_ShutdownDiskQueueSystem(void *ignored)
|
||||
{
|
||||
pool_destroy(&rf_dqd_pool);
|
||||
}
|
||||
|
||||
int
|
||||
rf_ConfigureDiskQueueSystem(listp)
|
||||
RF_ShutdownList_t **listp;
|
||||
rf_ConfigureDiskQueueSystem(RF_ShutdownList_t **listp)
|
||||
{
|
||||
int rc;
|
||||
|
||||
@ -238,10 +229,8 @@ rf_ConfigureDiskQueueSystem(listp)
|
||||
}
|
||||
|
||||
int
|
||||
rf_ConfigureDiskQueues(
|
||||
RF_ShutdownList_t ** listp,
|
||||
RF_Raid_t * raidPtr,
|
||||
RF_Config_t * cfgPtr)
|
||||
rf_ConfigureDiskQueues(RF_ShutdownList_t **listp, RF_Raid_t *raidPtr,
|
||||
RF_Config_t *cfgPtr)
|
||||
{
|
||||
RF_DiskQueue_t *diskQueues, *spareQueues;
|
||||
const RF_DiskQueueSW_t *p;
|
||||
@ -324,10 +313,7 @@ rf_ConfigureDiskQueues(
|
||||
* Do the same as at user level, with the sleeps and wakeups suppressed.
|
||||
*/
|
||||
void
|
||||
rf_DiskIOEnqueue(queue, req, pri)
|
||||
RF_DiskQueue_t *queue;
|
||||
RF_DiskQueueData_t *req;
|
||||
int pri;
|
||||
rf_DiskIOEnqueue(RF_DiskQueue_t *queue, RF_DiskQueueData_t *req, int pri)
|
||||
{
|
||||
RF_ETIMER_START(req->qtime);
|
||||
RF_ASSERT(req->type == RF_IO_TYPE_NOP || req->numSector);
|
||||
@ -384,10 +370,7 @@ rf_DiskIOEnqueue(queue, req, pri)
|
||||
|
||||
/* get the next set of I/Os started, kernel version only */
|
||||
void
|
||||
rf_DiskIOComplete(queue, req, status)
|
||||
RF_DiskQueue_t *queue;
|
||||
RF_DiskQueueData_t *req;
|
||||
int status;
|
||||
rf_DiskIOComplete(RF_DiskQueue_t *queue, RF_DiskQueueData_t *req, int status)
|
||||
{
|
||||
int done = 0;
|
||||
|
||||
@ -475,10 +458,8 @@ rf_DiskIOComplete(queue, req, status)
|
||||
* a queue, this routine does nothing and returns -1.
|
||||
*/
|
||||
int
|
||||
rf_DiskIOPromote(queue, parityStripeID, which_ru)
|
||||
RF_DiskQueue_t *queue;
|
||||
RF_StripeNum_t parityStripeID;
|
||||
RF_ReconUnitNum_t which_ru;
|
||||
rf_DiskIOPromote(RF_DiskQueue_t *queue, RF_StripeNum_t parityStripeID,
|
||||
RF_ReconUnitNum_t which_ru)
|
||||
{
|
||||
int retval;
|
||||
|
||||
@ -491,20 +472,14 @@ rf_DiskIOPromote(queue, parityStripeID, which_ru)
|
||||
}
|
||||
|
||||
RF_DiskQueueData_t *
|
||||
rf_CreateDiskQueueData(
|
||||
RF_IoType_t typ,
|
||||
RF_SectorNum_t ssect,
|
||||
RF_SectorCount_t nsect,
|
||||
caddr_t buf,
|
||||
RF_StripeNum_t parityStripeID,
|
||||
RF_ReconUnitNum_t which_ru,
|
||||
int (*wakeF) (void *, int),
|
||||
void *arg,
|
||||
RF_DiskQueueData_t * next,
|
||||
RF_AccTraceEntry_t * tracerec,
|
||||
void *raidPtr,
|
||||
RF_DiskQueueDataFlags_t flags,
|
||||
void *kb_proc)
|
||||
rf_CreateDiskQueueData(RF_IoType_t typ, RF_SectorNum_t ssect,
|
||||
RF_SectorCount_t nsect, caddr_t buf,
|
||||
RF_StripeNum_t parityStripeID,
|
||||
RF_ReconUnitNum_t which_ru,
|
||||
int (*wakeF) (void *, int), void *arg,
|
||||
RF_DiskQueueData_t *next,
|
||||
RF_AccTraceEntry_t *tracerec, void *raidPtr,
|
||||
RF_DiskQueueDataFlags_t flags, void *kb_proc)
|
||||
{
|
||||
RF_DiskQueueData_t *p;
|
||||
|
||||
@ -533,8 +508,7 @@ rf_CreateDiskQueueData(
|
||||
}
|
||||
|
||||
void
|
||||
rf_FreeDiskQueueData(p)
|
||||
RF_DiskQueueData_t *p;
|
||||
rf_FreeDiskQueueData(RF_DiskQueueData_t *p)
|
||||
{
|
||||
clean_dqd(p);
|
||||
pool_put(&rf_dqd_pool, p);
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: rf_disks.c,v 1.48 2003/12/30 17:46:59 oster Exp $ */
|
||||
/* $NetBSD: rf_disks.c,v 1.49 2003/12/30 21:59:03 oster Exp $ */
|
||||
/*-
|
||||
* Copyright (c) 1999 The NetBSD Foundation, Inc.
|
||||
* All rights reserved.
|
||||
@ -67,7 +67,7 @@
|
||||
***************************************************************/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: rf_disks.c,v 1.48 2003/12/30 17:46:59 oster Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: rf_disks.c,v 1.49 2003/12/30 21:59:03 oster Exp $");
|
||||
|
||||
#include <dev/raidframe/raidframevar.h>
|
||||
|
||||
@ -110,10 +110,8 @@ static int rf_check_label_vitals( RF_Raid_t *, int, int, char *,
|
||||
**************************************************************************/
|
||||
|
||||
int
|
||||
rf_ConfigureDisks( listp, raidPtr, cfgPtr )
|
||||
RF_ShutdownList_t **listp;
|
||||
RF_Raid_t *raidPtr;
|
||||
RF_Config_t *cfgPtr;
|
||||
rf_ConfigureDisks(RF_ShutdownList_t **listp, RF_Raid_t *raidPtr,
|
||||
RF_Config_t *cfgPtr)
|
||||
{
|
||||
RF_RaidDisk_t *disks;
|
||||
RF_SectorCount_t min_numblks = (RF_SectorCount_t) 0x7FFFFFFFFFFFLL;
|
||||
@ -236,10 +234,8 @@ fail:
|
||||
* in row zero, which is specially expanded to hold them.
|
||||
****************************************************************************/
|
||||
int
|
||||
rf_ConfigureSpareDisks( listp, raidPtr, cfgPtr )
|
||||
RF_ShutdownList_t ** listp;
|
||||
RF_Raid_t * raidPtr;
|
||||
RF_Config_t * cfgPtr;
|
||||
rf_ConfigureSpareDisks(RF_ShutdownList_t **listp, RF_Raid_t *raidPtr,
|
||||
RF_Config_t *cfgPtr)
|
||||
{
|
||||
int i, ret;
|
||||
unsigned int bs;
|
||||
@ -316,9 +312,7 @@ fail:
|
||||
}
|
||||
|
||||
static int
|
||||
rf_AllocDiskStructures(raidPtr, cfgPtr)
|
||||
RF_Raid_t *raidPtr;
|
||||
RF_Config_t *cfgPtr;
|
||||
rf_AllocDiskStructures(RF_Raid_t *raidPtr, RF_Config_t *cfgPtr)
|
||||
{
|
||||
int ret;
|
||||
|
||||
@ -353,10 +347,8 @@ fail:
|
||||
|
||||
/* configure a single disk during auto-configuration at boot */
|
||||
int
|
||||
rf_AutoConfigureDisks(raidPtr, cfgPtr, auto_config)
|
||||
RF_Raid_t *raidPtr;
|
||||
RF_Config_t *cfgPtr;
|
||||
RF_AutoConfig_t *auto_config;
|
||||
rf_AutoConfigureDisks(RF_Raid_t *raidPtr, RF_Config_t *cfgPtr,
|
||||
RF_AutoConfig_t *auto_config)
|
||||
{
|
||||
RF_RaidDisk_t *disks;
|
||||
RF_RaidDisk_t *diskPtr;
|
||||
@ -572,11 +564,8 @@ fail:
|
||||
|
||||
/* configure a single disk in the array */
|
||||
int
|
||||
rf_ConfigureDisk(raidPtr, buf, diskPtr, col)
|
||||
RF_Raid_t *raidPtr;
|
||||
char *buf;
|
||||
RF_RaidDisk_t *diskPtr;
|
||||
RF_RowCol_t col;
|
||||
rf_ConfigureDisk(RF_Raid_t *raidPtr, char *buf, RF_RaidDisk_t *diskPtr,
|
||||
RF_RowCol_t col)
|
||||
{
|
||||
char *p;
|
||||
struct partinfo dpart;
|
||||
@ -643,11 +632,8 @@ rf_ConfigureDisk(raidPtr, buf, diskPtr, col)
|
||||
}
|
||||
|
||||
static void
|
||||
rf_print_label_status( raidPtr, column, dev_name, ci_label )
|
||||
RF_Raid_t *raidPtr;
|
||||
int column;
|
||||
char *dev_name;
|
||||
RF_ComponentLabel_t *ci_label;
|
||||
rf_print_label_status(RF_Raid_t *raidPtr, int column, char *dev_name,
|
||||
RF_ComponentLabel_t *ci_label)
|
||||
{
|
||||
|
||||
printf("raid%d: Component %s being configured at col: %d\n",
|
||||
@ -662,15 +648,9 @@ rf_print_label_status( raidPtr, column, dev_name, ci_label )
|
||||
ci_label->clean ? "Yes" : "No", ci_label->status );
|
||||
}
|
||||
|
||||
static int rf_check_label_vitals( raidPtr, row, column, dev_name, ci_label,
|
||||
serial_number, mod_counter )
|
||||
RF_Raid_t *raidPtr;
|
||||
int row;
|
||||
int column;
|
||||
char *dev_name;
|
||||
RF_ComponentLabel_t *ci_label;
|
||||
int serial_number;
|
||||
int mod_counter;
|
||||
static int rf_check_label_vitals(RF_Raid_t *raidPtr, int row, int column,
|
||||
char *dev_name, RF_ComponentLabel_t *ci_label,
|
||||
int serial_number, int mod_counter)
|
||||
{
|
||||
int fatal_error = 0;
|
||||
|
||||
@ -712,9 +692,7 @@ static int rf_check_label_vitals( raidPtr, row, column, dev_name, ci_label,
|
||||
*/
|
||||
|
||||
int
|
||||
rf_CheckLabels( raidPtr, cfgPtr )
|
||||
RF_Raid_t *raidPtr;
|
||||
RF_Config_t *cfgPtr;
|
||||
rf_CheckLabels(RF_Raid_t *raidPtr, RF_Config_t *cfgPtr)
|
||||
{
|
||||
int c;
|
||||
char *dev_name;
|
||||
@ -963,9 +941,7 @@ rf_CheckLabels( raidPtr, cfgPtr )
|
||||
}
|
||||
|
||||
int
|
||||
rf_add_hot_spare(raidPtr, sparePtr)
|
||||
RF_Raid_t *raidPtr;
|
||||
RF_SingleComponent_t *sparePtr;
|
||||
rf_add_hot_spare(RF_Raid_t *raidPtr, RF_SingleComponent_t *sparePtr)
|
||||
{
|
||||
RF_RaidDisk_t *disks;
|
||||
RF_DiskQueue_t *spareQueues;
|
||||
@ -1067,9 +1043,7 @@ fail:
|
||||
}
|
||||
|
||||
int
|
||||
rf_remove_hot_spare(raidPtr,sparePtr)
|
||||
RF_Raid_t *raidPtr;
|
||||
RF_SingleComponent_t *sparePtr;
|
||||
rf_remove_hot_spare(RF_Raid_t *raidPtr, RF_SingleComponent_t *sparePtr)
|
||||
{
|
||||
int spare_number;
|
||||
|
||||
@ -1102,9 +1076,7 @@ rf_remove_hot_spare(raidPtr,sparePtr)
|
||||
|
||||
|
||||
int
|
||||
rf_delete_component(raidPtr,component)
|
||||
RF_Raid_t *raidPtr;
|
||||
RF_SingleComponent_t *component;
|
||||
rf_delete_component(RF_Raid_t *raidPtr, RF_SingleComponent_t *component)
|
||||
{
|
||||
RF_RaidDisk_t *disks;
|
||||
|
||||
@ -1121,9 +1093,7 @@ rf_delete_component(raidPtr,component)
|
||||
}
|
||||
|
||||
int
|
||||
rf_incorporate_hot_spare(raidPtr,component)
|
||||
RF_Raid_t *raidPtr;
|
||||
RF_SingleComponent_t *component;
|
||||
rf_incorporate_hot_spare(RF_Raid_t *raidPtr, RF_SingleComponent_t *component)
|
||||
{
|
||||
|
||||
/* Issues here include how to 'move' this in if there is IO
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: rf_engine.c,v 1.28 2003/12/29 06:19:28 oster Exp $ */
|
||||
/* $NetBSD: rf_engine.c,v 1.29 2003/12/30 21:59:03 oster Exp $ */
|
||||
/*
|
||||
* Copyright (c) 1995 Carnegie-Mellon University.
|
||||
* All rights reserved.
|
||||
@ -55,7 +55,7 @@
|
||||
****************************************************************************/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: rf_engine.c,v 1.28 2003/12/29 06:19:28 oster Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: rf_engine.c,v 1.29 2003/12/30 21:59:03 oster Exp $");
|
||||
|
||||
#include <sys/errno.h>
|
||||
|
||||
@ -93,8 +93,7 @@ do { \
|
||||
RF_BROADCAST_COND((_r_)->node_queue) /* XXX RF_SIGNAL_COND? */
|
||||
|
||||
static void
|
||||
rf_ShutdownEngine(arg)
|
||||
void *arg;
|
||||
rf_ShutdownEngine(void *arg)
|
||||
{
|
||||
RF_Raid_t *raidPtr;
|
||||
int ks;
|
||||
@ -123,10 +122,8 @@ rf_ShutdownEngine(arg)
|
||||
}
|
||||
|
||||
int
|
||||
rf_ConfigureEngine(
|
||||
RF_ShutdownList_t ** listp,
|
||||
RF_Raid_t * raidPtr,
|
||||
RF_Config_t * cfgPtr)
|
||||
rf_ConfigureEngine(RF_ShutdownList_t **listp, RF_Raid_t *raidPtr,
|
||||
RF_Config_t *cfgPtr)
|
||||
{
|
||||
int rc;
|
||||
|
||||
@ -172,7 +169,7 @@ rf_ConfigureEngine(
|
||||
}
|
||||
|
||||
static int
|
||||
BranchDone(RF_DagNode_t * node)
|
||||
BranchDone(RF_DagNode_t *node)
|
||||
{
|
||||
int i;
|
||||
|
||||
@ -213,7 +210,7 @@ BranchDone(RF_DagNode_t * node)
|
||||
}
|
||||
|
||||
static int
|
||||
NodeReady(RF_DagNode_t * node)
|
||||
NodeReady(RF_DagNode_t *node)
|
||||
{
|
||||
int ready;
|
||||
|
||||
@ -253,7 +250,7 @@ NodeReady(RF_DagNode_t * node)
|
||||
* set to "fired" or "recover" to indicate the direction of execution.
|
||||
*/
|
||||
static void
|
||||
FireNode(RF_DagNode_t * node)
|
||||
FireNode(RF_DagNode_t *node)
|
||||
{
|
||||
switch (node->status) {
|
||||
case rf_fired:
|
||||
@ -306,9 +303,7 @@ FireNode(RF_DagNode_t * node)
|
||||
* The entire list is fired atomically.
|
||||
*/
|
||||
static void
|
||||
FireNodeArray(
|
||||
int numNodes,
|
||||
RF_DagNode_t ** nodeList)
|
||||
FireNodeArray(int numNodes, RF_DagNode_t **nodeList)
|
||||
{
|
||||
RF_DagStatus_t dstat;
|
||||
RF_DagNode_t *node;
|
||||
@ -352,7 +347,7 @@ FireNodeArray(
|
||||
* The entire list is fired atomically.
|
||||
*/
|
||||
static void
|
||||
FireNodeList(RF_DagNode_t * nodeList)
|
||||
FireNodeList(RF_DagNode_t *nodeList)
|
||||
{
|
||||
RF_DagNode_t *node, *next;
|
||||
RF_DagStatus_t dstat;
|
||||
@ -409,9 +404,7 @@ FireNodeList(RF_DagNode_t * nodeList)
|
||||
* entire function, but this is certainly overkill.
|
||||
*/
|
||||
static void
|
||||
PropagateResults(
|
||||
RF_DagNode_t * node,
|
||||
int context)
|
||||
PropagateResults(RF_DagNode_t *node, int context)
|
||||
{
|
||||
RF_DagNode_t *s, *a;
|
||||
RF_Raid_t *raidPtr;
|
||||
@ -617,9 +610,7 @@ PropagateResults(
|
||||
* Process a fired node which has completed
|
||||
*/
|
||||
static void
|
||||
ProcessNode(
|
||||
RF_DagNode_t * node,
|
||||
int context)
|
||||
ProcessNode(RF_DagNode_t *node, int context)
|
||||
{
|
||||
RF_Raid_t *raidPtr;
|
||||
|
||||
@ -671,9 +662,7 @@ ProcessNode(
|
||||
* as complete and fire off any successors that have been enabled.
|
||||
*/
|
||||
int
|
||||
rf_FinishNode(
|
||||
RF_DagNode_t * node,
|
||||
int context)
|
||||
rf_FinishNode(RF_DagNode_t *node, int context)
|
||||
{
|
||||
int retcode = RF_FALSE;
|
||||
node->dagHdr->numNodesCompleted++;
|
||||
@ -694,10 +683,8 @@ rf_FinishNode(
|
||||
* All we do here is fire the direct successors of the header node.
|
||||
* The DAG execution thread does the rest of the dag processing. */
|
||||
int
|
||||
rf_DispatchDAG(
|
||||
RF_DagHeader_t * dag,
|
||||
void (*cbFunc) (void *),
|
||||
void *cbArg)
|
||||
rf_DispatchDAG(RF_DagHeader_t *dag, void (*cbFunc) (void *),
|
||||
void *cbArg)
|
||||
{
|
||||
RF_Raid_t *raidPtr;
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: rf_evenodd.c,v 1.11 2003/12/29 03:33:48 oster Exp $ */
|
||||
/* $NetBSD: rf_evenodd.c,v 1.12 2003/12/30 21:59:03 oster Exp $ */
|
||||
/*
|
||||
* Copyright (c) 1995 Carnegie-Mellon University.
|
||||
* All rights reserved.
|
||||
@ -33,7 +33,7 @@
|
||||
****************************************************************************************/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: rf_evenodd.c,v 1.11 2003/12/29 03:33:48 oster Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: rf_evenodd.c,v 1.12 2003/12/30 21:59:03 oster Exp $");
|
||||
|
||||
#include "rf_archs.h"
|
||||
|
||||
@ -68,10 +68,8 @@ typedef struct RF_EvenOddConfigInfo_s {
|
||||
} RF_EvenOddConfigInfo_t;
|
||||
|
||||
int
|
||||
rf_ConfigureEvenOdd(listp, raidPtr, cfgPtr)
|
||||
RF_ShutdownList_t **listp;
|
||||
RF_Raid_t *raidPtr;
|
||||
RF_Config_t *cfgPtr;
|
||||
rf_ConfigureEvenOdd(RF_ShutdownList_t **listp, RF_Raid_t *raidPtr,
|
||||
RF_Config_t *cfgPtr)
|
||||
{
|
||||
RF_RaidLayout_t *layoutPtr = &raidPtr->Layout;
|
||||
RF_EvenOddConfigInfo_t *info;
|
||||
@ -123,23 +121,20 @@ rf_ConfigureEvenOdd(listp, raidPtr, cfgPtr)
|
||||
}
|
||||
|
||||
int
|
||||
rf_GetDefaultNumFloatingReconBuffersEvenOdd(RF_Raid_t * raidPtr)
|
||||
rf_GetDefaultNumFloatingReconBuffersEvenOdd(RF_Raid_t *raidPtr)
|
||||
{
|
||||
return (20);
|
||||
}
|
||||
|
||||
RF_HeadSepLimit_t
|
||||
rf_GetDefaultHeadSepLimitEvenOdd(RF_Raid_t * raidPtr)
|
||||
rf_GetDefaultHeadSepLimitEvenOdd(RF_Raid_t *raidPtr)
|
||||
{
|
||||
return (10);
|
||||
}
|
||||
|
||||
void
|
||||
rf_IdentifyStripeEvenOdd(
|
||||
RF_Raid_t * raidPtr,
|
||||
RF_RaidAddr_t addr,
|
||||
RF_RowCol_t ** diskids,
|
||||
RF_RowCol_t * outRow)
|
||||
rf_IdentifyStripeEvenOdd(RF_Raid_t *raidPtr, RF_RaidAddr_t addr,
|
||||
RF_RowCol_t **diskids, RF_RowCol_t *outRow)
|
||||
{
|
||||
RF_StripeNum_t stripeID = rf_RaidAddressToStripeID(&raidPtr->Layout, addr);
|
||||
RF_EvenOddConfigInfo_t *info = (RF_EvenOddConfigInfo_t *) raidPtr->Layout.layoutSpecificInfo;
|
||||
@ -163,13 +158,9 @@ rf_IdentifyStripeEvenOdd(
|
||||
|
||||
|
||||
void
|
||||
rf_MapParityEvenOdd(
|
||||
RF_Raid_t * raidPtr,
|
||||
RF_RaidAddr_t raidSector,
|
||||
RF_RowCol_t * row,
|
||||
RF_RowCol_t * col,
|
||||
RF_SectorNum_t * diskSector,
|
||||
int remap)
|
||||
rf_MapParityEvenOdd(RF_Raid_t *raidPtr, RF_RaidAddr_t raidSector,
|
||||
RF_RowCol_t *row, RF_RowCol_t *col,
|
||||
RF_SectorNum_t *diskSector, int remap)
|
||||
{
|
||||
RF_StripeNum_t SUID = raidSector / raidPtr->Layout.sectorsPerStripeUnit;
|
||||
RF_StripeNum_t endSUIDofthisStrip = (SUID / raidPtr->Layout.numDataCol + 1) * raidPtr->Layout.numDataCol - 1;
|
||||
@ -181,13 +172,9 @@ rf_MapParityEvenOdd(
|
||||
}
|
||||
|
||||
void
|
||||
rf_MapEEvenOdd(
|
||||
RF_Raid_t * raidPtr,
|
||||
RF_RaidAddr_t raidSector,
|
||||
RF_RowCol_t * row,
|
||||
RF_RowCol_t * col,
|
||||
RF_SectorNum_t * diskSector,
|
||||
int remap)
|
||||
rf_MapEEvenOdd(RF_Raid_t *raidPtr, RF_RaidAddr_t raidSector,
|
||||
RF_RowCol_t *row, RF_RowCol_t *col, RF_SectorNum_t *diskSector,
|
||||
int remap)
|
||||
{
|
||||
RF_StripeNum_t SUID = raidSector / raidPtr->Layout.sectorsPerStripeUnit;
|
||||
RF_StripeNum_t endSUIDofthisStrip = (SUID / raidPtr->Layout.numDataCol + 1) * raidPtr->Layout.numDataCol - 1;
|
||||
@ -199,11 +186,8 @@ rf_MapEEvenOdd(
|
||||
}
|
||||
|
||||
void
|
||||
rf_EODagSelect(
|
||||
RF_Raid_t * raidPtr,
|
||||
RF_IoType_t type,
|
||||
RF_AccessStripeMap_t * asmap,
|
||||
RF_VoidFuncPtr * createFunc)
|
||||
rf_EODagSelect(RF_Raid_t *raidPtr, RF_IoType_t type,
|
||||
RF_AccessStripeMap_t *asmap, RF_VoidFuncPtr *createFunc)
|
||||
{
|
||||
RF_RaidLayout_t *layoutPtr = &(raidPtr->Layout);
|
||||
unsigned ndfail = asmap->numDataFailed;
|
||||
@ -349,12 +333,9 @@ rf_EODagSelect(
|
||||
|
||||
|
||||
int
|
||||
rf_VerifyParityEvenOdd(raidPtr, raidAddr, parityPDA, correct_it, flags)
|
||||
RF_Raid_t *raidPtr;
|
||||
RF_RaidAddr_t raidAddr;
|
||||
RF_PhysDiskAddr_t *parityPDA;
|
||||
int correct_it;
|
||||
RF_RaidAccessFlags_t flags;
|
||||
rf_VerifyParityEvenOdd(RF_Raid_t *raidPtr, RF_RaidAddr_t raidAddr,
|
||||
RF_PhysDiskAddr_t *parityPDA, int correct_it,
|
||||
RF_RaidAccessFlags_t flags)
|
||||
{
|
||||
RF_RaidLayout_t *layoutPtr = &(raidPtr->Layout);
|
||||
RF_RaidAddr_t startAddr = rf_RaidAddressOfPrevStripeBoundary(layoutPtr, raidAddr);
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: rf_fifo.c,v 1.9 2003/12/29 03:33:48 oster Exp $ */
|
||||
/* $NetBSD: rf_fifo.c,v 1.10 2003/12/30 21:59:03 oster Exp $ */
|
||||
/*
|
||||
* Copyright (c) 1995 Carnegie-Mellon University.
|
||||
* All rights reserved.
|
||||
@ -36,7 +36,7 @@
|
||||
***************************************************/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: rf_fifo.c,v 1.9 2003/12/29 03:33:48 oster Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: rf_fifo.c,v 1.10 2003/12/30 21:59:03 oster Exp $");
|
||||
|
||||
#include <dev/raidframe/raidframevar.h>
|
||||
|
||||
@ -53,10 +53,8 @@ __KERNEL_RCSID(0, "$NetBSD: rf_fifo.c,v 1.9 2003/12/29 03:33:48 oster Exp $");
|
||||
/* just malloc a header, zero it (via calloc), and return it */
|
||||
/*ARGSUSED*/
|
||||
void *
|
||||
rf_FifoCreate(sectPerDisk, clList, listp)
|
||||
RF_SectorCount_t sectPerDisk;
|
||||
RF_AllocListElem_t *clList;
|
||||
RF_ShutdownList_t **listp;
|
||||
rf_FifoCreate(RF_SectorCount_t sectPerDisk, RF_AllocListElem_t *clList,
|
||||
RF_ShutdownList_t **listp)
|
||||
{
|
||||
RF_FifoHeader_t *q;
|
||||
|
||||
@ -67,10 +65,7 @@ rf_FifoCreate(sectPerDisk, clList, listp)
|
||||
}
|
||||
|
||||
void
|
||||
rf_FifoEnqueue(q_in, elem, priority)
|
||||
void *q_in;
|
||||
RF_DiskQueueData_t *elem;
|
||||
int priority;
|
||||
rf_FifoEnqueue(void *q_in, RF_DiskQueueData_t *elem, int priority)
|
||||
{
|
||||
RF_FifoHeader_t *q = (RF_FifoHeader_t *) q_in;
|
||||
|
||||
@ -118,8 +113,7 @@ rf_FifoEnqueue(q_in, elem, priority)
|
||||
}
|
||||
|
||||
RF_DiskQueueData_t *
|
||||
rf_FifoDequeue(q_in)
|
||||
void *q_in;
|
||||
rf_FifoDequeue(void *q_in)
|
||||
{
|
||||
RF_FifoHeader_t *q = (RF_FifoHeader_t *) q_in;
|
||||
RF_DiskQueueData_t *nd;
|
||||
@ -180,10 +174,8 @@ rf_FifoPeek(void *q_in)
|
||||
* We assume the queue is locked upon entry.
|
||||
*/
|
||||
int
|
||||
rf_FifoPromote(q_in, parityStripeID, which_ru)
|
||||
void *q_in;
|
||||
RF_StripeNum_t parityStripeID;
|
||||
RF_ReconUnitNum_t which_ru;
|
||||
rf_FifoPromote(void *q_in, RF_StripeNum_t parityStripeID,
|
||||
RF_ReconUnitNum_t which_ru)
|
||||
{
|
||||
RF_FifoHeader_t *q = (RF_FifoHeader_t *) q_in;
|
||||
RF_DiskQueueData_t *lp = q->lq_head, *pt = NULL; /* lp = lo-pri queue
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: rf_layout.c,v 1.14 2003/02/09 10:04:33 jdolecek Exp $ */
|
||||
/* $NetBSD: rf_layout.c,v 1.15 2003/12/30 21:59:03 oster 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.14 2003/02/09 10:04:33 jdolecek Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: rf_layout.c,v 1.15 2003/12/30 21:59:03 oster Exp $");
|
||||
|
||||
#include <dev/raidframe/raidframevar.h>
|
||||
|
||||
@ -399,10 +399,8 @@ rf_GetLayout(RF_ParityConfig_t parityConfig)
|
||||
*
|
||||
****************************************************************************/
|
||||
int
|
||||
rf_ConfigureLayout(
|
||||
RF_ShutdownList_t ** listp,
|
||||
RF_Raid_t * raidPtr,
|
||||
RF_Config_t * cfgPtr)
|
||||
rf_ConfigureLayout(RF_ShutdownList_t **listp, RF_Raid_t *raidPtr,
|
||||
RF_Config_t *cfgPtr)
|
||||
{
|
||||
RF_RaidLayout_t *layoutPtr = &(raidPtr->Layout);
|
||||
RF_ParityConfig_t parityConfig;
|
||||
@ -461,10 +459,9 @@ rf_ConfigureLayout(
|
||||
* a RaidAddressToParityStripeID macro in layout.h
|
||||
*/
|
||||
RF_StripeNum_t
|
||||
rf_MapStripeIDToParityStripeID(layoutPtr, stripeID, which_ru)
|
||||
RF_RaidLayout_t *layoutPtr;
|
||||
RF_StripeNum_t stripeID;
|
||||
RF_ReconUnitNum_t *which_ru;
|
||||
rf_MapStripeIDToParityStripeID(RF_RaidLayout_t *layoutPtr,
|
||||
RF_StripeNum_t stripeID,
|
||||
RF_ReconUnitNum_t *which_ru)
|
||||
{
|
||||
RF_StripeNum_t parityStripeID;
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: rf_map.c,v 1.25 2003/12/29 17:13:36 oster Exp $ */
|
||||
/* $NetBSD: rf_map.c,v 1.26 2003/12/30 21:59:03 oster Exp $ */
|
||||
/*
|
||||
* Copyright (c) 1995 Carnegie-Mellon University.
|
||||
* All rights reserved.
|
||||
@ -33,7 +33,7 @@
|
||||
**************************************************************************/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: rf_map.c,v 1.25 2003/12/29 17:13:36 oster Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: rf_map.c,v 1.26 2003/12/30 21:59:03 oster Exp $");
|
||||
|
||||
#include <dev/raidframe/raidframevar.h>
|
||||
|
||||
@ -71,17 +71,15 @@ static void rf_FreeASMList(RF_AccessStripeMap_t * start,
|
||||
*
|
||||
* This routine returns NULL if numBlocks is 0
|
||||
*
|
||||
* raidAddress - starting address in RAID address space
|
||||
* numBlocks - number of blocks in RAID address space to access
|
||||
* buffer - buffer to supply/recieve data
|
||||
* remap - 1 => remap address to spare space
|
||||
***************************************************************************/
|
||||
|
||||
RF_AccessStripeMapHeader_t *
|
||||
rf_MapAccess(raidPtr, raidAddress, numBlocks, buffer, remap)
|
||||
RF_Raid_t *raidPtr;
|
||||
RF_RaidAddr_t raidAddress; /* starting address in RAID address
|
||||
* space */
|
||||
RF_SectorCount_t numBlocks; /* number of blocks in RAID address
|
||||
* space to access */
|
||||
caddr_t buffer; /* buffer to supply/receive data */
|
||||
int remap; /* 1 => remap addresses to spare space */
|
||||
rf_MapAccess(RF_Raid_t *raidPtr, RF_RaidAddr_t raidAddress,
|
||||
RF_SectorCount_t numBlocks, caddr_t buffer, int remap)
|
||||
{
|
||||
RF_RaidLayout_t *layoutPtr = &(raidPtr->Layout);
|
||||
RF_AccessStripeMapHeader_t *asm_hdr = NULL;
|
||||
@ -266,9 +264,8 @@ rf_MapAccess(raidPtr, raidAddress, numBlocks, buffer, remap)
|
||||
***************************************************************************/
|
||||
|
||||
void
|
||||
rf_MarkFailuresInASMList(raidPtr, asm_h)
|
||||
RF_Raid_t *raidPtr;
|
||||
RF_AccessStripeMapHeader_t *asm_h;
|
||||
rf_MarkFailuresInASMList(RF_Raid_t *raidPtr,
|
||||
RF_AccessStripeMapHeader_t *asm_h)
|
||||
{
|
||||
RF_RaidDisk_t *disks = raidPtr->Disks;
|
||||
RF_AccessStripeMap_t *asmap;
|
||||
@ -336,8 +333,7 @@ static struct pool rf_pda_pool; /* may need to be visible for
|
||||
release all the free lists */
|
||||
static void rf_ShutdownMapModule(void *);
|
||||
static void
|
||||
rf_ShutdownMapModule(ignored)
|
||||
void *ignored;
|
||||
rf_ShutdownMapModule(void *ignored)
|
||||
{
|
||||
pool_destroy(&rf_asmhdr_pool);
|
||||
pool_destroy(&rf_asm_pool);
|
||||
@ -345,8 +341,7 @@ rf_ShutdownMapModule(ignored)
|
||||
}
|
||||
|
||||
int
|
||||
rf_ConfigureMapModule(listp)
|
||||
RF_ShutdownList_t **listp;
|
||||
rf_ConfigureMapModule(RF_ShutdownList_t **listp)
|
||||
{
|
||||
int rc;
|
||||
|
||||
@ -386,8 +381,7 @@ rf_AllocAccessStripeMapHeader()
|
||||
}
|
||||
|
||||
void
|
||||
rf_FreeAccessStripeMapHeader(p)
|
||||
RF_AccessStripeMapHeader_t *p;
|
||||
rf_FreeAccessStripeMapHeader(RF_AccessStripeMapHeader_t *p)
|
||||
{
|
||||
pool_put(&rf_asmhdr_pool, p);
|
||||
}
|
||||
@ -408,8 +402,7 @@ rf_AllocPhysDiskAddr()
|
||||
* not be much of a performance hit, because it should be very
|
||||
* infrequently executed. */
|
||||
RF_PhysDiskAddr_t *
|
||||
rf_AllocPDAList(count)
|
||||
int count;
|
||||
rf_AllocPDAList(int count)
|
||||
{
|
||||
RF_PhysDiskAddr_t *p, *prev;
|
||||
int i;
|
||||
@ -427,18 +420,17 @@ rf_AllocPDAList(count)
|
||||
|
||||
#if RF_INCLUDE_PARITYLOGGING > 0
|
||||
void
|
||||
rf_FreePhysDiskAddr(p)
|
||||
RF_PhysDiskAddr_t *p;
|
||||
rf_FreePhysDiskAddr(RF_PhysDiskAddr_t *p)
|
||||
{
|
||||
pool_put(&rf_pda_pool, p);
|
||||
}
|
||||
#endif
|
||||
|
||||
/* l_start, l_end - pointers to start and end of list
|
||||
* count - number of elements in list
|
||||
*/
|
||||
static void
|
||||
rf_FreePDAList(l_start, l_end, count)
|
||||
RF_PhysDiskAddr_t *l_start, *l_end; /* pointers to start and end
|
||||
* of list */
|
||||
int count; /* number of elements in list */
|
||||
rf_FreePDAList(RF_PhysDiskAddr_t *l_start, RF_PhysDiskAddr_t *l_end, int count)
|
||||
{
|
||||
RF_PhysDiskAddr_t *p, *tmp;
|
||||
|
||||
@ -456,8 +448,7 @@ rf_FreePDAList(l_start, l_end, count)
|
||||
* shutdown. This should not be much of a performance hit, because it
|
||||
* should be very infrequently executed. */
|
||||
RF_AccessStripeMap_t *
|
||||
rf_AllocASMList(count)
|
||||
int count;
|
||||
rf_AllocASMList(int count)
|
||||
{
|
||||
RF_AccessStripeMap_t *p, *prev;
|
||||
int i;
|
||||
@ -473,9 +464,8 @@ rf_AllocASMList(count)
|
||||
}
|
||||
|
||||
static void
|
||||
rf_FreeASMList(l_start, l_end, count)
|
||||
RF_AccessStripeMap_t *l_start, *l_end;
|
||||
int count;
|
||||
rf_FreeASMList(RF_AccessStripeMap_t *l_start, RF_AccessStripeMap_t *l_end,
|
||||
int count)
|
||||
{
|
||||
RF_AccessStripeMap_t *p, *tmp;
|
||||
|
||||
@ -488,8 +478,7 @@ rf_FreeASMList(l_start, l_end, count)
|
||||
}
|
||||
|
||||
void
|
||||
rf_FreeAccessStripeMap(hdr)
|
||||
RF_AccessStripeMapHeader_t *hdr;
|
||||
rf_FreeAccessStripeMap(RF_AccessStripeMapHeader_t *hdr)
|
||||
{
|
||||
RF_AccessStripeMap_t *p, *pt = NULL;
|
||||
RF_PhysDiskAddr_t *pdp, *trailer, *pdaList = NULL, *pdaEnd = NULL;
|
||||
@ -559,9 +548,7 @@ rf_FreeAccessStripeMap(hdr)
|
||||
*
|
||||
* ASSUMES AT MOST ONE FAILURE IN THE STRIPE. */
|
||||
int
|
||||
rf_CheckStripeForFailures(raidPtr, asmap)
|
||||
RF_Raid_t *raidPtr;
|
||||
RF_AccessStripeMap_t *asmap;
|
||||
rf_CheckStripeForFailures(RF_Raid_t *raidPtr, RF_AccessStripeMap_t *asmap)
|
||||
{
|
||||
RF_RowCol_t tcol, pcol, *diskids, i;
|
||||
RF_RaidLayout_t *layoutPtr = &raidPtr->Layout;
|
||||
@ -613,9 +600,7 @@ rf_CheckStripeForFailures(raidPtr, asmap)
|
||||
*/
|
||||
|
||||
int
|
||||
rf_NumFailedDataUnitsInStripe(raidPtr, asmap)
|
||||
RF_Raid_t *raidPtr;
|
||||
RF_AccessStripeMap_t *asmap;
|
||||
rf_NumFailedDataUnitsInStripe(RF_Raid_t *raidPtr, RF_AccessStripeMap_t *asmap)
|
||||
{
|
||||
RF_RaidLayout_t *layoutPtr = &raidPtr->Layout;
|
||||
RF_RowCol_t tcol, i;
|
||||
@ -651,17 +636,15 @@ rf_NumFailedDataUnitsInStripe(raidPtr, asmap)
|
||||
***************************************************************************/
|
||||
#if RF_DEBUG_MAP
|
||||
void
|
||||
rf_PrintAccessStripeMap(asm_h)
|
||||
RF_AccessStripeMapHeader_t *asm_h;
|
||||
rf_PrintAccessStripeMap(RF_AccessStripeMapHeader_t *asm_h)
|
||||
{
|
||||
rf_PrintFullAccessStripeMap(asm_h, 0);
|
||||
}
|
||||
#endif
|
||||
|
||||
/* prbuf - flag to print buffer pointers */
|
||||
void
|
||||
rf_PrintFullAccessStripeMap(asm_h, prbuf)
|
||||
RF_AccessStripeMapHeader_t *asm_h;
|
||||
int prbuf; /* flag to print buffer pointers */
|
||||
rf_PrintFullAccessStripeMap(RF_AccessStripeMapHeader_t *asm_h, int prbuf)
|
||||
{
|
||||
int i;
|
||||
RF_AccessStripeMap_t *asmap = asm_h->stripeMap;
|
||||
@ -715,10 +698,8 @@ rf_PrintFullAccessStripeMap(asm_h, prbuf)
|
||||
|
||||
#if RF_MAP_DEBUG
|
||||
void
|
||||
rf_PrintRaidAddressInfo(raidPtr, raidAddr, numBlocks)
|
||||
RF_Raid_t *raidPtr;
|
||||
RF_RaidAddr_t raidAddr;
|
||||
RF_SectorCount_t numBlocks;
|
||||
rf_PrintRaidAddressInfo(RF_Raid_t *raidPtr, RF_RaidAddr_t raidAddr,
|
||||
RF_SectorCount_t numBlocks)
|
||||
{
|
||||
RF_RaidLayout_t *layoutPtr = &raidPtr->Layout;
|
||||
RF_RaidAddr_t ra, sosAddr = rf_RaidAddressOfPrevStripeBoundary(layoutPtr, raidAddr);
|
||||
@ -737,12 +718,11 @@ rf_PrintRaidAddressInfo(raidPtr, raidAddr, numBlocks)
|
||||
* range restrict the parity descriptor to touch only the correct
|
||||
* stuff. */
|
||||
void
|
||||
rf_ASMParityAdjust(
|
||||
RF_PhysDiskAddr_t * toAdjust,
|
||||
RF_StripeNum_t startAddrWithinStripe,
|
||||
RF_SectorNum_t endAddress,
|
||||
RF_RaidLayout_t * layoutPtr,
|
||||
RF_AccessStripeMap_t * asm_p)
|
||||
rf_ASMParityAdjust(RF_PhysDiskAddr_t *toAdjust,
|
||||
RF_StripeNum_t startAddrWithinStripe,
|
||||
RF_SectorNum_t endAddress,
|
||||
RF_RaidLayout_t *layoutPtr,
|
||||
RF_AccessStripeMap_t *asm_p)
|
||||
{
|
||||
RF_PhysDiskAddr_t *new_pda;
|
||||
|
||||
@ -795,12 +775,9 @@ rf_ASMParityAdjust(
|
||||
* I/O. If it has been failed, record it in the asm pointer. Fourth
|
||||
* arg is whether data or parity. */
|
||||
void
|
||||
rf_ASMCheckStatus(
|
||||
RF_Raid_t * raidPtr,
|
||||
RF_PhysDiskAddr_t * pda_p,
|
||||
RF_AccessStripeMap_t * asm_p,
|
||||
RF_RaidDisk_t * disks,
|
||||
int parity)
|
||||
rf_ASMCheckStatus(RF_Raid_t *raidPtr, RF_PhysDiskAddr_t *pda_p,
|
||||
RF_AccessStripeMap_t *asm_p, RF_RaidDisk_t *disks,
|
||||
int parity)
|
||||
{
|
||||
RF_DiskStatus_t dstatus;
|
||||
RF_RowCol_t fcol;
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: rf_mcpair.c,v 1.11 2003/12/29 04:34:36 oster Exp $ */
|
||||
/* $NetBSD: rf_mcpair.c,v 1.12 2003/12/30 21:59:03 oster Exp $ */
|
||||
/*
|
||||
* Copyright (c) 1995 Carnegie-Mellon University.
|
||||
* All rights reserved.
|
||||
@ -32,7 +32,7 @@
|
||||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: rf_mcpair.c,v 1.11 2003/12/29 04:34:36 oster Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: rf_mcpair.c,v 1.12 2003/12/30 21:59:03 oster Exp $");
|
||||
|
||||
#include <dev/raidframe/raidframevar.h>
|
||||
|
||||
@ -54,15 +54,13 @@ static struct pool rf_mcpair_pool;
|
||||
static void rf_ShutdownMCPair(void *);
|
||||
|
||||
static void
|
||||
rf_ShutdownMCPair(ignored)
|
||||
void *ignored;
|
||||
rf_ShutdownMCPair(void *ignored)
|
||||
{
|
||||
pool_destroy(&rf_mcpair_pool);
|
||||
}
|
||||
|
||||
int
|
||||
rf_ConfigureMCPair(listp)
|
||||
RF_ShutdownList_t **listp;
|
||||
rf_ConfigureMCPair(RF_ShutdownList_t **listp)
|
||||
{
|
||||
int rc;
|
||||
|
||||
@ -97,8 +95,7 @@ rf_AllocMCPair()
|
||||
}
|
||||
|
||||
void
|
||||
rf_FreeMCPair(t)
|
||||
RF_MCPair_t *t;
|
||||
rf_FreeMCPair(RF_MCPair_t *t)
|
||||
{
|
||||
pool_put(&rf_mcpair_pool, t);
|
||||
}
|
||||
@ -106,8 +103,7 @@ rf_FreeMCPair(t)
|
||||
/* the callback function used to wake you up when you use an mcpair to
|
||||
wait for something */
|
||||
void
|
||||
rf_MCPairWakeupFunc(mcpair)
|
||||
RF_MCPair_t *mcpair;
|
||||
rf_MCPairWakeupFunc(RF_MCPair_t *mcpair)
|
||||
{
|
||||
RF_LOCK_MUTEX(mcpair->mutex);
|
||||
mcpair->flag = 1;
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: rf_netbsdkintf.c,v 1.168 2003/12/29 04:56:26 oster Exp $ */
|
||||
/* $NetBSD: rf_netbsdkintf.c,v 1.169 2003/12/30 21:59:03 oster Exp $ */
|
||||
/*-
|
||||
* Copyright (c) 1996, 1997, 1998 The NetBSD Foundation, Inc.
|
||||
* All rights reserved.
|
||||
@ -146,7 +146,7 @@
|
||||
***********************************************************/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: rf_netbsdkintf.c,v 1.168 2003/12/29 04:56:26 oster Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: rf_netbsdkintf.c,v 1.169 2003/12/30 21:59:03 oster Exp $");
|
||||
|
||||
#include <sys/param.h>
|
||||
#include <sys/errno.h>
|
||||
@ -336,8 +336,7 @@ static int raidautoconfig = 0; /* Debugging, mostly. Set to 0 to not
|
||||
kernel config file. */
|
||||
|
||||
void
|
||||
raidattach(num)
|
||||
int num;
|
||||
raidattach(int num)
|
||||
{
|
||||
int raidID;
|
||||
int i, rc;
|
||||
@ -511,8 +510,7 @@ rf_buildroothack(RF_ConfigSet_t *config_sets)
|
||||
|
||||
|
||||
int
|
||||
raidsize(dev)
|
||||
dev_t dev;
|
||||
raidsize(dev_t dev)
|
||||
{
|
||||
struct raid_softc *rs;
|
||||
struct disklabel *lp;
|
||||
@ -547,21 +545,14 @@ raidsize(dev)
|
||||
}
|
||||
|
||||
int
|
||||
raiddump(dev, blkno, va, size)
|
||||
dev_t dev;
|
||||
daddr_t blkno;
|
||||
caddr_t va;
|
||||
size_t size;
|
||||
raiddump(dev_t dev, daddr_t blkno, caddr_t va, size_t size)
|
||||
{
|
||||
/* Not implemented. */
|
||||
return ENXIO;
|
||||
}
|
||||
/* ARGSUSED */
|
||||
int
|
||||
raidopen(dev, flags, fmt, p)
|
||||
dev_t dev;
|
||||
int flags, fmt;
|
||||
struct proc *p;
|
||||
raidopen(dev_t dev, int flags, int fmt, struct proc *p)
|
||||
{
|
||||
int unit = raidunit(dev);
|
||||
struct raid_softc *rs;
|
||||
@ -631,10 +622,7 @@ raidopen(dev, flags, fmt, p)
|
||||
}
|
||||
/* ARGSUSED */
|
||||
int
|
||||
raidclose(dev, flags, fmt, p)
|
||||
dev_t dev;
|
||||
int flags, fmt;
|
||||
struct proc *p;
|
||||
raidclose(dev_t dev, int flags, int fmt, struct proc *p)
|
||||
{
|
||||
int unit = raidunit(dev);
|
||||
struct raid_softc *rs;
|
||||
@ -691,8 +679,7 @@ raidclose(dev, flags, fmt, p)
|
||||
}
|
||||
|
||||
void
|
||||
raidstrategy(bp)
|
||||
struct buf *bp;
|
||||
raidstrategy(struct buf *bp)
|
||||
{
|
||||
int s;
|
||||
|
||||
@ -755,10 +742,7 @@ raidstrategy(bp)
|
||||
}
|
||||
/* ARGSUSED */
|
||||
int
|
||||
raidread(dev, uio, flags)
|
||||
dev_t dev;
|
||||
struct uio *uio;
|
||||
int flags;
|
||||
raidread(dev_t dev, struct uio *uio, int flags)
|
||||
{
|
||||
int unit = raidunit(dev);
|
||||
struct raid_softc *rs;
|
||||
@ -775,10 +759,7 @@ raidread(dev, uio, flags)
|
||||
}
|
||||
/* ARGSUSED */
|
||||
int
|
||||
raidwrite(dev, uio, flags)
|
||||
dev_t dev;
|
||||
struct uio *uio;
|
||||
int flags;
|
||||
raidwrite(dev_t dev, struct uio *uio, int flags)
|
||||
{
|
||||
int unit = raidunit(dev);
|
||||
struct raid_softc *rs;
|
||||
@ -795,12 +776,7 @@ raidwrite(dev, uio, flags)
|
||||
}
|
||||
|
||||
int
|
||||
raidioctl(dev, cmd, data, flag, p)
|
||||
dev_t dev;
|
||||
u_long cmd;
|
||||
caddr_t data;
|
||||
int flag;
|
||||
struct proc *p;
|
||||
raidioctl(dev_t dev, u_long cmd, caddr_t data, int flag, struct proc *p)
|
||||
{
|
||||
int unit = raidunit(dev);
|
||||
int error = 0;
|
||||
@ -1610,8 +1586,7 @@ raidioctl(dev, cmd, data, flag, p)
|
||||
|
||||
|
||||
static void
|
||||
raidinit(raidPtr)
|
||||
RF_Raid_t *raidPtr;
|
||||
raidinit(RF_Raid_t *raidPtr)
|
||||
{
|
||||
struct raid_softc *rs;
|
||||
int unit;
|
||||
@ -1650,8 +1625,7 @@ raidinit(raidPtr)
|
||||
* XXX This code is not currently used. GO
|
||||
*/
|
||||
int
|
||||
rf_GetSpareTableFromDaemon(req)
|
||||
RF_SparetWait_t *req;
|
||||
rf_GetSpareTableFromDaemon(RF_SparetWait_t *req)
|
||||
{
|
||||
int retcode;
|
||||
|
||||
@ -1685,8 +1659,7 @@ rf_GetSpareTableFromDaemon(req)
|
||||
* Formerly known as: rf_DoAccessKernel
|
||||
*/
|
||||
void
|
||||
raidstart(raidPtr)
|
||||
RF_Raid_t *raidPtr;
|
||||
raidstart(RF_Raid_t *raidPtr)
|
||||
{
|
||||
RF_SectorCount_t num_blocks, pb, sum;
|
||||
RF_RaidAddr_t raid_addr;
|
||||
@ -1810,9 +1783,7 @@ raidstart(raidPtr)
|
||||
/* invoke an I/O from kernel mode. Disk queue should be locked upon entry */
|
||||
|
||||
int
|
||||
rf_DispatchKernelIO(queue, req)
|
||||
RF_DiskQueue_t *queue;
|
||||
RF_DiskQueueData_t *req;
|
||||
rf_DispatchKernelIO(RF_DiskQueue_t *queue, RF_DiskQueueData_t *req)
|
||||
{
|
||||
int op = (req->type == RF_IO_TYPE_READ) ? B_READ : B_WRITE;
|
||||
struct buf *bp;
|
||||
@ -1917,8 +1888,7 @@ rf_DispatchKernelIO(queue, req)
|
||||
kernel code.
|
||||
*/
|
||||
static void
|
||||
KernelWakeupFunc(vbp)
|
||||
struct buf *vbp;
|
||||
KernelWakeupFunc(struct buf *vbp)
|
||||
{
|
||||
RF_DiskQueueData_t *req = NULL;
|
||||
RF_DiskQueue_t *queue;
|
||||
@ -2003,19 +1973,10 @@ KernelWakeupFunc(vbp)
|
||||
* initialize a buf structure for doing an I/O in the kernel.
|
||||
*/
|
||||
static void
|
||||
InitBP(bp, b_vp, rw_flag, dev, startSect, numSect, buf, cbFunc, cbArg,
|
||||
logBytesPerSector, b_proc)
|
||||
struct buf *bp;
|
||||
struct vnode *b_vp;
|
||||
unsigned rw_flag;
|
||||
dev_t dev;
|
||||
RF_SectorNum_t startSect;
|
||||
RF_SectorCount_t numSect;
|
||||
caddr_t buf;
|
||||
void (*cbFunc) (struct buf *);
|
||||
void *cbArg;
|
||||
int logBytesPerSector;
|
||||
struct proc *b_proc;
|
||||
InitBP(struct buf *bp, struct vnode *b_vp, unsigned rw_flag, dev_t dev,
|
||||
RF_SectorNum_t startSect, RF_SectorCount_t numSect, caddr_t buf,
|
||||
void (*cbFunc) (struct buf *), void *cbArg, int logBytesPerSector,
|
||||
struct proc *b_proc)
|
||||
{
|
||||
/* bp->b_flags = B_PHYS | rw_flag; */
|
||||
bp->b_flags = B_CALL | rw_flag; /* XXX need B_PHYS here too??? */
|
||||
@ -2036,10 +1997,8 @@ InitBP(bp, b_vp, rw_flag, dev, startSect, numSect, buf, cbFunc, cbArg,
|
||||
}
|
||||
|
||||
static void
|
||||
raidgetdefaultlabel(raidPtr, rs, lp)
|
||||
RF_Raid_t *raidPtr;
|
||||
struct raid_softc *rs;
|
||||
struct disklabel *lp;
|
||||
raidgetdefaultlabel(RF_Raid_t *raidPtr, struct raid_softc *rs,
|
||||
struct disklabel *lp)
|
||||
{
|
||||
memset(lp, 0, sizeof(*lp));
|
||||
|
||||
@ -2074,8 +2033,7 @@ raidgetdefaultlabel(raidPtr, rs, lp)
|
||||
* up.
|
||||
*/
|
||||
static void
|
||||
raidgetdisklabel(dev)
|
||||
dev_t dev;
|
||||
raidgetdisklabel(dev_t dev)
|
||||
{
|
||||
int unit = raidunit(dev);
|
||||
struct raid_softc *rs = &raid_softc[unit];
|
||||
@ -2131,8 +2089,7 @@ raidgetdisklabel(dev)
|
||||
* that a disklabel isn't present.
|
||||
*/
|
||||
static void
|
||||
raidmakedisklabel(rs)
|
||||
struct raid_softc *rs;
|
||||
raidmakedisklabel(struct raid_softc *rs)
|
||||
{
|
||||
struct disklabel *lp = rs->sc_dkdev.dk_label;
|
||||
db1_printf(("Making a label..\n"));
|
||||
@ -2155,10 +2112,7 @@ raidmakedisklabel(rs)
|
||||
* You'll find the original of this in ccd.c
|
||||
*/
|
||||
int
|
||||
raidlookup(path, p, vpp)
|
||||
char *path;
|
||||
struct proc *p;
|
||||
struct vnode **vpp; /* result */
|
||||
raidlookup(char *path, struct proc *p, struct vnode **vpp)
|
||||
{
|
||||
struct nameidata nd;
|
||||
struct vnode *vp;
|
||||
@ -2198,8 +2152,7 @@ raidlookup(path, p, vpp)
|
||||
* (Hmm... where have we seen this warning before :-> GO )
|
||||
*/
|
||||
static int
|
||||
raidlock(rs)
|
||||
struct raid_softc *rs;
|
||||
raidlock(struct raid_softc *rs)
|
||||
{
|
||||
int error;
|
||||
|
||||
@ -2216,8 +2169,7 @@ raidlock(rs)
|
||||
* Unlock and wake up any waiters.
|
||||
*/
|
||||
static void
|
||||
raidunlock(rs)
|
||||
struct raid_softc *rs;
|
||||
raidunlock(struct raid_softc *rs)
|
||||
{
|
||||
|
||||
rs->sc_flags &= ~RAIDF_LOCKED;
|
||||
@ -2256,10 +2208,8 @@ raidmarkdirty(dev_t dev, struct vnode *b_vp, int mod_counter)
|
||||
|
||||
/* ARGSUSED */
|
||||
int
|
||||
raidread_component_label(dev, b_vp, clabel)
|
||||
dev_t dev;
|
||||
struct vnode *b_vp;
|
||||
RF_ComponentLabel_t *clabel;
|
||||
raidread_component_label(dev_t dev, struct vnode *b_vp,
|
||||
RF_ComponentLabel_t *clabel)
|
||||
{
|
||||
struct buf *bp;
|
||||
const struct bdevsw *bdev;
|
||||
@ -2301,10 +2251,8 @@ raidread_component_label(dev, b_vp, clabel)
|
||||
}
|
||||
/* ARGSUSED */
|
||||
int
|
||||
raidwrite_component_label(dev, b_vp, clabel)
|
||||
dev_t dev;
|
||||
struct vnode *b_vp;
|
||||
RF_ComponentLabel_t *clabel;
|
||||
raidwrite_component_label(dev_t dev, struct vnode *b_vp,
|
||||
RF_ComponentLabel_t *clabel)
|
||||
{
|
||||
struct buf *bp;
|
||||
const struct bdevsw *bdev;
|
||||
@ -2340,8 +2288,7 @@ raidwrite_component_label(dev, b_vp, clabel)
|
||||
}
|
||||
|
||||
void
|
||||
rf_markalldirty(raidPtr)
|
||||
RF_Raid_t *raidPtr;
|
||||
rf_markalldirty(RF_Raid_t *raidPtr)
|
||||
{
|
||||
RF_ComponentLabel_t clabel;
|
||||
int sparecol;
|
||||
@ -2413,9 +2360,7 @@ rf_markalldirty(raidPtr)
|
||||
|
||||
|
||||
void
|
||||
rf_update_component_labels(raidPtr, final)
|
||||
RF_Raid_t *raidPtr;
|
||||
int final;
|
||||
rf_update_component_labels(RF_Raid_t *raidPtr, int final)
|
||||
{
|
||||
RF_ComponentLabel_t clabel;
|
||||
int sparecol;
|
||||
@ -2506,10 +2451,7 @@ rf_update_component_labels(raidPtr, final)
|
||||
}
|
||||
|
||||
void
|
||||
rf_close_component(raidPtr, vp, auto_configured)
|
||||
RF_Raid_t *raidPtr;
|
||||
struct vnode *vp;
|
||||
int auto_configured;
|
||||
rf_close_component(RF_Raid_t *raidPtr, struct vnode *vp, int auto_configured)
|
||||
{
|
||||
struct proc *p;
|
||||
|
||||
@ -2529,8 +2471,7 @@ rf_close_component(raidPtr, vp, auto_configured)
|
||||
|
||||
|
||||
void
|
||||
rf_UnconfigureVnodes(raidPtr)
|
||||
RF_Raid_t *raidPtr;
|
||||
rf_UnconfigureVnodes(RF_Raid_t *raidPtr)
|
||||
{
|
||||
int r,c;
|
||||
struct vnode *vp;
|
||||
@ -2558,8 +2499,7 @@ rf_UnconfigureVnodes(raidPtr)
|
||||
|
||||
|
||||
void
|
||||
rf_ReconThread(req)
|
||||
struct rf_recon_req *req;
|
||||
rf_ReconThread(struct rf_recon_req *req)
|
||||
{
|
||||
int s;
|
||||
RF_Raid_t *raidPtr;
|
||||
@ -2582,8 +2522,7 @@ rf_ReconThread(req)
|
||||
}
|
||||
|
||||
void
|
||||
rf_RewriteParityThread(raidPtr)
|
||||
RF_Raid_t *raidPtr;
|
||||
rf_RewriteParityThread(RF_Raid_t *raidPtr)
|
||||
{
|
||||
int retcode;
|
||||
int s;
|
||||
@ -2613,8 +2552,7 @@ rf_RewriteParityThread(raidPtr)
|
||||
|
||||
|
||||
void
|
||||
rf_CopybackThread(raidPtr)
|
||||
RF_Raid_t *raidPtr;
|
||||
rf_CopybackThread(RF_Raid_t *raidPtr)
|
||||
{
|
||||
int s;
|
||||
|
||||
@ -2630,8 +2568,7 @@ rf_CopybackThread(raidPtr)
|
||||
|
||||
|
||||
void
|
||||
rf_ReconstructInPlaceThread(req)
|
||||
struct rf_recon_req *req;
|
||||
rf_ReconstructInPlaceThread(struct rf_recon_req *req)
|
||||
{
|
||||
int s;
|
||||
RF_Raid_t *raidPtr;
|
||||
@ -2802,8 +2739,7 @@ rf_find_raid_components()
|
||||
}
|
||||
|
||||
static int
|
||||
rf_reasonable_label(clabel)
|
||||
RF_ComponentLabel_t *clabel;
|
||||
rf_reasonable_label(RF_ComponentLabel_t *clabel)
|
||||
{
|
||||
|
||||
if (((clabel->version==RF_COMPONENT_LABEL_VERSION_1) ||
|
||||
@ -2827,8 +2763,7 @@ rf_reasonable_label(clabel)
|
||||
|
||||
#if DEBUG
|
||||
void
|
||||
rf_print_component_label(clabel)
|
||||
RF_ComponentLabel_t *clabel;
|
||||
rf_print_component_label(RF_ComponentLabel_t *clabel)
|
||||
{
|
||||
printf(" Row: %d Column: %d Num Rows: %d Num Columns: %d\n",
|
||||
clabel->row, clabel->column,
|
||||
@ -2855,8 +2790,7 @@ rf_print_component_label(clabel)
|
||||
#endif
|
||||
|
||||
RF_ConfigSet_t *
|
||||
rf_create_auto_sets(ac_list)
|
||||
RF_AutoConfig_t *ac_list;
|
||||
rf_create_auto_sets(RF_AutoConfig_t *ac_list)
|
||||
{
|
||||
RF_AutoConfig_t *ac;
|
||||
RF_ConfigSet_t *config_sets;
|
||||
@ -2922,9 +2856,7 @@ rf_create_auto_sets(ac_list)
|
||||
}
|
||||
|
||||
static int
|
||||
rf_does_it_fit(cset, ac)
|
||||
RF_ConfigSet_t *cset;
|
||||
RF_AutoConfig_t *ac;
|
||||
rf_does_it_fit(RF_ConfigSet_t *cset, RF_AutoConfig_t *ac)
|
||||
{
|
||||
RF_ComponentLabel_t *clabel1, *clabel2;
|
||||
|
||||
@ -2981,8 +2913,7 @@ rf_does_it_fit(cset, ac)
|
||||
}
|
||||
|
||||
int
|
||||
rf_have_enough_components(cset)
|
||||
RF_ConfigSet_t *cset;
|
||||
rf_have_enough_components(RF_ConfigSet_t *cset)
|
||||
{
|
||||
RF_AutoConfig_t *ac;
|
||||
RF_AutoConfig_t *auto_config;
|
||||
@ -3085,10 +3016,8 @@ rf_have_enough_components(cset)
|
||||
}
|
||||
|
||||
void
|
||||
rf_create_configuration(ac,config,raidPtr)
|
||||
RF_AutoConfig_t *ac;
|
||||
RF_Config_t *config;
|
||||
RF_Raid_t *raidPtr;
|
||||
rf_create_configuration(RF_AutoConfig_t *ac, RF_Config_t *config,
|
||||
RF_Raid_t *raidPtr)
|
||||
{
|
||||
RF_ComponentLabel_t *clabel;
|
||||
int i;
|
||||
@ -3122,9 +3051,7 @@ rf_create_configuration(ac,config,raidPtr)
|
||||
}
|
||||
|
||||
int
|
||||
rf_set_autoconfig(raidPtr, new_value)
|
||||
RF_Raid_t *raidPtr;
|
||||
int new_value;
|
||||
rf_set_autoconfig(RF_Raid_t *raidPtr, int new_value)
|
||||
{
|
||||
RF_ComponentLabel_t clabel;
|
||||
struct vnode *vp;
|
||||
@ -3157,9 +3084,7 @@ rf_set_autoconfig(raidPtr, new_value)
|
||||
}
|
||||
|
||||
int
|
||||
rf_set_rootpartition(raidPtr, new_value)
|
||||
RF_Raid_t *raidPtr;
|
||||
int new_value;
|
||||
rf_set_rootpartition(RF_Raid_t *raidPtr, int new_value)
|
||||
{
|
||||
RF_ComponentLabel_t clabel;
|
||||
struct vnode *vp;
|
||||
@ -3191,8 +3116,7 @@ rf_set_rootpartition(raidPtr, new_value)
|
||||
}
|
||||
|
||||
void
|
||||
rf_release_all_vps(cset)
|
||||
RF_ConfigSet_t *cset;
|
||||
rf_release_all_vps(RF_ConfigSet_t *cset)
|
||||
{
|
||||
RF_AutoConfig_t *ac;
|
||||
|
||||
@ -3211,8 +3135,7 @@ rf_release_all_vps(cset)
|
||||
|
||||
|
||||
void
|
||||
rf_cleanup_config_set(cset)
|
||||
RF_ConfigSet_t *cset;
|
||||
rf_cleanup_config_set(RF_ConfigSet_t *cset)
|
||||
{
|
||||
RF_AutoConfig_t *ac;
|
||||
RF_AutoConfig_t *next_ac;
|
||||
@ -3233,9 +3156,7 @@ rf_cleanup_config_set(cset)
|
||||
|
||||
|
||||
void
|
||||
raid_init_component_label(raidPtr, clabel)
|
||||
RF_Raid_t *raidPtr;
|
||||
RF_ComponentLabel_t *clabel;
|
||||
raid_init_component_label(RF_Raid_t *raidPtr, RF_ComponentLabel_t *clabel)
|
||||
{
|
||||
/* current version number */
|
||||
clabel->version = RF_COMPONENT_LABEL_VERSION;
|
||||
@ -3263,9 +3184,7 @@ raid_init_component_label(raidPtr, clabel)
|
||||
}
|
||||
|
||||
int
|
||||
rf_auto_config_set(cset,unit)
|
||||
RF_ConfigSet_t *cset;
|
||||
int *unit;
|
||||
rf_auto_config_set(RF_ConfigSet_t *cset, int *unit)
|
||||
{
|
||||
RF_Raid_t *raidPtr;
|
||||
RF_Config_t *config;
|
||||
@ -3365,8 +3284,7 @@ rf_auto_config_set(cset,unit)
|
||||
}
|
||||
|
||||
void
|
||||
rf_disk_unbusy(desc)
|
||||
RF_RaidAccessDesc_t *desc;
|
||||
rf_disk_unbusy(RF_RaidAccessDesc_t *desc)
|
||||
{
|
||||
struct buf *bp;
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: rf_nwayxor.c,v 1.5 2001/11/13 07:11:15 lukem Exp $ */
|
||||
/* $NetBSD: rf_nwayxor.c,v 1.6 2003/12/30 21:59:03 oster Exp $ */
|
||||
/*
|
||||
* Copyright (c) 1995 Carnegie-Mellon University.
|
||||
* All rights reserved.
|
||||
@ -36,7 +36,7 @@
|
||||
************************************************************/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: rf_nwayxor.c,v 1.5 2001/11/13 07:11:15 lukem Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: rf_nwayxor.c,v 1.6 2003/12/30 21:59:03 oster Exp $");
|
||||
|
||||
#include "rf_nwayxor.h"
|
||||
#include "rf_shutdown.h"
|
||||
@ -45,8 +45,7 @@ static int callcount[10];
|
||||
static void rf_ShutdownNWayXor(void *);
|
||||
|
||||
static void
|
||||
rf_ShutdownNWayXor(ignored)
|
||||
void *ignored;
|
||||
rf_ShutdownNWayXor(void *ignored)
|
||||
{
|
||||
int i;
|
||||
|
||||
@ -59,8 +58,7 @@ rf_ShutdownNWayXor(ignored)
|
||||
}
|
||||
|
||||
int
|
||||
rf_ConfigureNWayXor(listp)
|
||||
RF_ShutdownList_t **listp;
|
||||
rf_ConfigureNWayXor(RF_ShutdownList_t **listp)
|
||||
{
|
||||
int i, rc;
|
||||
|
||||
@ -71,10 +69,7 @@ rf_ConfigureNWayXor(listp)
|
||||
}
|
||||
|
||||
void
|
||||
rf_nWayXor1(src_rbs, dest_rb, len)
|
||||
RF_ReconBuffer_t **src_rbs;
|
||||
RF_ReconBuffer_t *dest_rb;
|
||||
int len;
|
||||
rf_nWayXor1(RF_ReconBuffer_t **src_rbs, RF_ReconBuffer_t *dest_rb, int len)
|
||||
{
|
||||
unsigned long *src = (unsigned long *) src_rbs[0]->buffer;
|
||||
unsigned long *dest = (unsigned long *) dest_rb->buffer;
|
||||
@ -105,10 +100,7 @@ rf_nWayXor1(src_rbs, dest_rb, len)
|
||||
}
|
||||
|
||||
void
|
||||
rf_nWayXor2(src_rbs, dest_rb, len)
|
||||
RF_ReconBuffer_t **src_rbs;
|
||||
RF_ReconBuffer_t *dest_rb;
|
||||
int len;
|
||||
rf_nWayXor2(RF_ReconBuffer_t **src_rbs, RF_ReconBuffer_t *dest_rb, int len)
|
||||
{
|
||||
unsigned long *dst = (unsigned long *) dest_rb->buffer;
|
||||
unsigned long *a = dst;
|
||||
@ -198,10 +190,7 @@ rf_nWayXor2(src_rbs, dest_rb, len)
|
||||
|
||||
|
||||
void
|
||||
rf_nWayXor3(src_rbs, dest_rb, len)
|
||||
RF_ReconBuffer_t **src_rbs;
|
||||
RF_ReconBuffer_t *dest_rb;
|
||||
int len;
|
||||
rf_nWayXor3(RF_ReconBuffer_t **src_rbs, RF_ReconBuffer_t *dest_rb, int len)
|
||||
{
|
||||
unsigned long *dst = (unsigned long *) dest_rb->buffer;
|
||||
unsigned long *b = (unsigned long *) src_rbs[0]->buffer;
|
||||
@ -228,10 +217,7 @@ rf_nWayXor3(src_rbs, dest_rb, len)
|
||||
}
|
||||
|
||||
void
|
||||
rf_nWayXor4(src_rbs, dest_rb, len)
|
||||
RF_ReconBuffer_t **src_rbs;
|
||||
RF_ReconBuffer_t *dest_rb;
|
||||
int len;
|
||||
rf_nWayXor4(RF_ReconBuffer_t **src_rbs, RF_ReconBuffer_t *dest_rb, int len)
|
||||
{
|
||||
unsigned long *dst = (unsigned long *) dest_rb->buffer;
|
||||
unsigned long *b = (unsigned long *) src_rbs[0]->buffer;
|
||||
@ -260,10 +246,7 @@ rf_nWayXor4(src_rbs, dest_rb, len)
|
||||
}
|
||||
|
||||
void
|
||||
rf_nWayXor5(src_rbs, dest_rb, len)
|
||||
RF_ReconBuffer_t **src_rbs;
|
||||
RF_ReconBuffer_t *dest_rb;
|
||||
int len;
|
||||
rf_nWayXor5(RF_ReconBuffer_t **src_rbs, RF_ReconBuffer_t *dest_rb, int len)
|
||||
{
|
||||
unsigned long *dst = (unsigned long *) dest_rb->buffer;
|
||||
unsigned long *b = (unsigned long *) src_rbs[0]->buffer;
|
||||
@ -294,10 +277,7 @@ rf_nWayXor5(src_rbs, dest_rb, len)
|
||||
}
|
||||
|
||||
void
|
||||
rf_nWayXor6(src_rbs, dest_rb, len)
|
||||
RF_ReconBuffer_t **src_rbs;
|
||||
RF_ReconBuffer_t *dest_rb;
|
||||
int len;
|
||||
rf_nWayXor6(RF_ReconBuffer_t **src_rbs, RF_ReconBuffer_t *dest_rb, int len)
|
||||
{
|
||||
unsigned long *dst = (unsigned long *) dest_rb->buffer;
|
||||
unsigned long *b = (unsigned long *) src_rbs[0]->buffer;
|
||||
@ -330,10 +310,7 @@ rf_nWayXor6(src_rbs, dest_rb, len)
|
||||
}
|
||||
|
||||
void
|
||||
rf_nWayXor7(src_rbs, dest_rb, len)
|
||||
RF_ReconBuffer_t **src_rbs;
|
||||
RF_ReconBuffer_t *dest_rb;
|
||||
int len;
|
||||
rf_nWayXor7(RF_ReconBuffer_t **src_rbs, RF_ReconBuffer_t *dest_rb, int len)
|
||||
{
|
||||
unsigned long *dst = (unsigned long *) dest_rb->buffer;
|
||||
unsigned long *b = (unsigned long *) src_rbs[0]->buffer;
|
||||
@ -368,10 +345,7 @@ rf_nWayXor7(src_rbs, dest_rb, len)
|
||||
}
|
||||
|
||||
void
|
||||
rf_nWayXor8(src_rbs, dest_rb, len)
|
||||
RF_ReconBuffer_t **src_rbs;
|
||||
RF_ReconBuffer_t *dest_rb;
|
||||
int len;
|
||||
rf_nWayXor8(RF_ReconBuffer_t **src_rbs, RF_ReconBuffer_t *dest_rb, int len)
|
||||
{
|
||||
unsigned long *dst = (unsigned long *) dest_rb->buffer;
|
||||
unsigned long *b = (unsigned long *) src_rbs[0]->buffer;
|
||||
@ -409,10 +383,7 @@ rf_nWayXor8(src_rbs, dest_rb, len)
|
||||
|
||||
|
||||
void
|
||||
rf_nWayXor9(src_rbs, dest_rb, len)
|
||||
RF_ReconBuffer_t **src_rbs;
|
||||
RF_ReconBuffer_t *dest_rb;
|
||||
int len;
|
||||
rf_nWayXor9(RF_ReconBuffer_t **src_rbs, RF_ReconBuffer_t *dest_rb, int len)
|
||||
{
|
||||
unsigned long *dst = (unsigned long *) dest_rb->buffer;
|
||||
unsigned long *b = (unsigned long *) src_rbs[0]->buffer;
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: rf_psstatus.c,v 1.18 2003/12/29 05:01:14 oster Exp $ */
|
||||
/* $NetBSD: rf_psstatus.c,v 1.19 2003/12/30 21:59:03 oster Exp $ */
|
||||
/*
|
||||
* Copyright (c) 1995 Carnegie-Mellon University.
|
||||
* All rights reserved.
|
||||
@ -37,7 +37,7 @@
|
||||
*****************************************************************************/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: rf_psstatus.c,v 1.18 2003/12/29 05:01:14 oster Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: rf_psstatus.c,v 1.19 2003/12/30 21:59:03 oster Exp $");
|
||||
|
||||
#include <dev/raidframe/raidframevar.h>
|
||||
|
||||
@ -68,8 +68,7 @@ RealPrintPSStatusTable(RF_Raid_t * raidPtr,
|
||||
static void rf_ShutdownPSStatus(void *);
|
||||
|
||||
static void
|
||||
rf_ShutdownPSStatus(arg)
|
||||
void *arg;
|
||||
rf_ShutdownPSStatus(void *arg)
|
||||
{
|
||||
RF_Raid_t *raidPtr = (RF_Raid_t *) arg;
|
||||
|
||||
@ -78,10 +77,8 @@ rf_ShutdownPSStatus(arg)
|
||||
}
|
||||
|
||||
int
|
||||
rf_ConfigurePSStatus(
|
||||
RF_ShutdownList_t ** listp,
|
||||
RF_Raid_t * raidPtr,
|
||||
RF_Config_t * cfgPtr)
|
||||
rf_ConfigurePSStatus(RF_ShutdownList_t **listp, RF_Raid_t *raidPtr,
|
||||
RF_Config_t *cfgPtr)
|
||||
{
|
||||
int rc;
|
||||
|
||||
@ -109,8 +106,7 @@ rf_ConfigurePSStatus(
|
||||
* malloc up hash chain entries.
|
||||
****************************************************************************************/
|
||||
RF_PSStatusHeader_t *
|
||||
rf_MakeParityStripeStatusTable(raidPtr)
|
||||
RF_Raid_t *raidPtr;
|
||||
rf_MakeParityStripeStatusTable(RF_Raid_t *raidPtr)
|
||||
{
|
||||
RF_PSStatusHeader_t *pssTable;
|
||||
int i;
|
||||
@ -125,9 +121,8 @@ rf_MakeParityStripeStatusTable(raidPtr)
|
||||
}
|
||||
|
||||
void
|
||||
rf_FreeParityStripeStatusTable(raidPtr, pssTable)
|
||||
RF_Raid_t *raidPtr;
|
||||
RF_PSStatusHeader_t *pssTable;
|
||||
rf_FreeParityStripeStatusTable(RF_Raid_t *raidPtr,
|
||||
RF_PSStatusHeader_t *pssTable)
|
||||
{
|
||||
int i;
|
||||
|
||||
@ -149,16 +144,14 @@ rf_FreeParityStripeStatusTable(raidPtr, pssTable)
|
||||
* otherwise returns NULL if the status structure does not exist
|
||||
*
|
||||
* ASSUMES THE PSS DESCRIPTOR IS LOCKED UPON ENTRY
|
||||
*
|
||||
* flags - whether or not to create it if it doesn't exist and what flags
|
||||
* to set it to initially
|
||||
*/
|
||||
RF_ReconParityStripeStatus_t *
|
||||
rf_LookupRUStatus(
|
||||
RF_Raid_t * raidPtr,
|
||||
RF_PSStatusHeader_t * pssTable,
|
||||
RF_StripeNum_t psID,
|
||||
RF_ReconUnitNum_t which_ru,
|
||||
RF_PSSFlags_t flags, /* whether or not to create it if it doesn't
|
||||
* exist + what flags to set initially */
|
||||
int *created)
|
||||
rf_LookupRUStatus(RF_Raid_t *raidPtr, RF_PSStatusHeader_t *pssTable,
|
||||
RF_StripeNum_t psID, RF_ReconUnitNum_t which_ru,
|
||||
RF_PSSFlags_t flags, int *created)
|
||||
{
|
||||
RF_PSStatusHeader_t *hdr = &pssTable[RF_HASH_PSID(raidPtr, psID)];
|
||||
RF_ReconParityStripeStatus_t *p, *pssPtr = hdr->chain;
|
||||
@ -206,10 +199,8 @@ rf_LookupRUStatus(
|
||||
* chain is ALREADY LOCKED.
|
||||
*/
|
||||
void
|
||||
rf_PSStatusDelete(raidPtr, pssTable, pssPtr)
|
||||
RF_Raid_t *raidPtr;
|
||||
RF_PSStatusHeader_t *pssTable;
|
||||
RF_ReconParityStripeStatus_t *pssPtr;
|
||||
rf_PSStatusDelete(RF_Raid_t *raidPtr, RF_PSStatusHeader_t *pssTable,
|
||||
RF_ReconParityStripeStatus_t *pssPtr)
|
||||
{
|
||||
RF_PSStatusHeader_t *hdr = &(pssTable[RF_HASH_PSID(raidPtr, pssPtr->parityStripeID)]);
|
||||
RF_ReconParityStripeStatus_t *p = hdr->chain, *pt = NULL;
|
||||
@ -231,10 +222,8 @@ rf_PSStatusDelete(raidPtr, pssTable, pssPtr)
|
||||
}
|
||||
/* deletes an entry from the ps status table after reconstruction has completed */
|
||||
void
|
||||
rf_RemoveFromActiveReconTable(raidPtr, psid, which_ru)
|
||||
RF_Raid_t *raidPtr;
|
||||
RF_ReconUnitNum_t which_ru;
|
||||
RF_StripeNum_t psid;
|
||||
rf_RemoveFromActiveReconTable(RF_Raid_t *raidPtr, RF_StripeNum_t psid,
|
||||
RF_ReconUnitNum_t which_ru)
|
||||
{
|
||||
RF_PSStatusHeader_t *hdr = &(raidPtr->reconControl->pssTable[RF_HASH_PSID(raidPtr, psid)]);
|
||||
RF_ReconParityStripeStatus_t *p, *pt;
|
||||
@ -280,8 +269,7 @@ rf_RemoveFromActiveReconTable(raidPtr, psid, which_ru)
|
||||
}
|
||||
|
||||
RF_ReconParityStripeStatus_t *
|
||||
rf_AllocPSStatus(raidPtr)
|
||||
RF_Raid_t *raidPtr;
|
||||
rf_AllocPSStatus(RF_Raid_t *raidPtr)
|
||||
{
|
||||
RF_ReconParityStripeStatus_t *p;
|
||||
|
||||
@ -295,9 +283,7 @@ rf_AllocPSStatus(raidPtr)
|
||||
}
|
||||
|
||||
void
|
||||
rf_FreePSStatus(raidPtr, p)
|
||||
RF_Raid_t *raidPtr;
|
||||
RF_ReconParityStripeStatus_t *p;
|
||||
rf_FreePSStatus(RF_Raid_t *raidPtr, RF_ReconParityStripeStatus_t *p)
|
||||
{
|
||||
RF_ASSERT(p->procWaitList == NULL);
|
||||
RF_ASSERT(p->blockWaitList == NULL);
|
||||
@ -308,9 +294,7 @@ rf_FreePSStatus(raidPtr, p)
|
||||
}
|
||||
|
||||
static void
|
||||
RealPrintPSStatusTable(raidPtr, pssTable)
|
||||
RF_Raid_t *raidPtr;
|
||||
RF_PSStatusHeader_t *pssTable;
|
||||
RealPrintPSStatusTable(RF_Raid_t *raidPtr, RF_PSStatusHeader_t *pssTable)
|
||||
{
|
||||
int i, j, procsWaiting, blocksWaiting, bufsWaiting;
|
||||
RF_ReconParityStripeStatus_t *p;
|
||||
@ -350,8 +334,7 @@ RealPrintPSStatusTable(raidPtr, pssTable)
|
||||
}
|
||||
|
||||
void
|
||||
rf_PrintPSStatusTable(raidPtr)
|
||||
RF_Raid_t *raidPtr;
|
||||
rf_PrintPSStatusTable(RF_Raid_t *raidPtr)
|
||||
{
|
||||
RF_PSStatusHeader_t *pssTable = raidPtr->reconControl->pssTable;
|
||||
RealPrintPSStatusTable(raidPtr, pssTable);
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: rf_raid0.c,v 1.8 2003/12/29 02:38:18 oster Exp $ */
|
||||
/* $NetBSD: rf_raid0.c,v 1.9 2003/12/30 21:59:03 oster Exp $ */
|
||||
/*
|
||||
* Copyright (c) 1995 Carnegie-Mellon University.
|
||||
* All rights reserved.
|
||||
@ -33,7 +33,7 @@
|
||||
***************************************/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: rf_raid0.c,v 1.8 2003/12/29 02:38:18 oster Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: rf_raid0.c,v 1.9 2003/12/30 21:59:03 oster Exp $");
|
||||
|
||||
#include <dev/raidframe/raidframevar.h>
|
||||
|
||||
@ -52,10 +52,8 @@ typedef struct RF_Raid0ConfigInfo_s {
|
||||
} RF_Raid0ConfigInfo_t;
|
||||
|
||||
int
|
||||
rf_ConfigureRAID0(
|
||||
RF_ShutdownList_t ** listp,
|
||||
RF_Raid_t * raidPtr,
|
||||
RF_Config_t * cfgPtr)
|
||||
rf_ConfigureRAID0(RF_ShutdownList_t **listp, RF_Raid_t *raidPtr,
|
||||
RF_Config_t *cfgPtr)
|
||||
{
|
||||
RF_RaidLayout_t *layoutPtr = &raidPtr->Layout;
|
||||
RF_Raid0ConfigInfo_t *info;
|
||||
@ -83,12 +81,8 @@ rf_ConfigureRAID0(
|
||||
}
|
||||
|
||||
void
|
||||
rf_MapSectorRAID0(
|
||||
RF_Raid_t * raidPtr,
|
||||
RF_RaidAddr_t raidSector,
|
||||
RF_RowCol_t * col,
|
||||
RF_SectorNum_t * diskSector,
|
||||
int remap)
|
||||
rf_MapSectorRAID0(RF_Raid_t *raidPtr, RF_RaidAddr_t raidSector,
|
||||
RF_RowCol_t *col, RF_SectorNum_t *diskSector, int remap)
|
||||
{
|
||||
RF_StripeNum_t SUID = raidSector / raidPtr->Layout.sectorsPerStripeUnit;
|
||||
*col = SUID % raidPtr->numCol;
|
||||
@ -97,22 +91,16 @@ rf_MapSectorRAID0(
|
||||
}
|
||||
|
||||
void
|
||||
rf_MapParityRAID0(
|
||||
RF_Raid_t * raidPtr,
|
||||
RF_RaidAddr_t raidSector,
|
||||
RF_RowCol_t * col,
|
||||
RF_SectorNum_t * diskSector,
|
||||
int remap)
|
||||
rf_MapParityRAID0(RF_Raid_t *raidPtr, RF_RaidAddr_t raidSector,
|
||||
RF_RowCol_t *col, RF_SectorNum_t *diskSector, int remap)
|
||||
{
|
||||
*col = 0;
|
||||
*diskSector = 0;
|
||||
}
|
||||
|
||||
void
|
||||
rf_IdentifyStripeRAID0(
|
||||
RF_Raid_t * raidPtr,
|
||||
RF_RaidAddr_t addr,
|
||||
RF_RowCol_t ** diskids)
|
||||
rf_IdentifyStripeRAID0(RF_Raid_t *raidPtr, RF_RaidAddr_t addr,
|
||||
RF_RowCol_t **diskids)
|
||||
{
|
||||
RF_Raid0ConfigInfo_t *info;
|
||||
|
||||
@ -121,11 +109,8 @@ rf_IdentifyStripeRAID0(
|
||||
}
|
||||
|
||||
void
|
||||
rf_MapSIDToPSIDRAID0(
|
||||
RF_RaidLayout_t * layoutPtr,
|
||||
RF_StripeNum_t stripeID,
|
||||
RF_StripeNum_t * psID,
|
||||
RF_ReconUnitNum_t * which_ru)
|
||||
rf_MapSIDToPSIDRAID0(RF_RaidLayout_t *layoutPtr, RF_StripeNum_t stripeID,
|
||||
RF_StripeNum_t *psID, RF_ReconUnitNum_t *which_ru)
|
||||
{
|
||||
*which_ru = 0;
|
||||
*psID = stripeID;
|
||||
@ -143,12 +128,9 @@ rf_RAID0DagSelect(
|
||||
}
|
||||
|
||||
int
|
||||
rf_VerifyParityRAID0(
|
||||
RF_Raid_t * raidPtr,
|
||||
RF_RaidAddr_t raidAddr,
|
||||
RF_PhysDiskAddr_t * parityPDA,
|
||||
int correct_it,
|
||||
RF_RaidAccessFlags_t flags)
|
||||
rf_VerifyParityRAID0(RF_Raid_t *raidPtr, RF_RaidAddr_t raidAddr,
|
||||
RF_PhysDiskAddr_t *parityPDA, int correct_it,
|
||||
RF_RaidAccessFlags_t flags)
|
||||
{
|
||||
/*
|
||||
* No parity is always okay.
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: rf_raid1.c,v 1.14 2003/12/29 02:38:18 oster Exp $ */
|
||||
/* $NetBSD: rf_raid1.c,v 1.15 2003/12/30 21:59:03 oster 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.14 2003/12/29 02:38:18 oster Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: rf_raid1.c,v 1.15 2003/12/30 21:59:03 oster Exp $");
|
||||
|
||||
#include "rf_raid.h"
|
||||
#include "rf_raid1.h"
|
||||
@ -58,10 +58,8 @@ typedef struct RF_Raid1ConfigInfo_s {
|
||||
} RF_Raid1ConfigInfo_t;
|
||||
/* start of day code specific to RAID level 1 */
|
||||
int
|
||||
rf_ConfigureRAID1(
|
||||
RF_ShutdownList_t ** listp,
|
||||
RF_Raid_t * raidPtr,
|
||||
RF_Config_t * cfgPtr)
|
||||
rf_ConfigureRAID1(RF_ShutdownList_t **listp, RF_Raid_t *raidPtr,
|
||||
RF_Config_t *cfgPtr)
|
||||
{
|
||||
RF_RaidLayout_t *layoutPtr = &raidPtr->Layout;
|
||||
RF_Raid1ConfigInfo_t *info;
|
||||
@ -97,12 +95,8 @@ rf_ConfigureRAID1(
|
||||
|
||||
/* returns the physical disk location of the primary copy in the mirror pair */
|
||||
void
|
||||
rf_MapSectorRAID1(
|
||||
RF_Raid_t * raidPtr,
|
||||
RF_RaidAddr_t raidSector,
|
||||
RF_RowCol_t * col,
|
||||
RF_SectorNum_t * diskSector,
|
||||
int remap)
|
||||
rf_MapSectorRAID1(RF_Raid_t *raidPtr, RF_RaidAddr_t raidSector,
|
||||
RF_RowCol_t *col, RF_SectorNum_t *diskSector, int remap)
|
||||
{
|
||||
RF_StripeNum_t SUID = raidSector / raidPtr->Layout.sectorsPerStripeUnit;
|
||||
RF_RowCol_t mirrorPair = SUID % (raidPtr->numCol / 2);
|
||||
@ -118,12 +112,8 @@ rf_MapSectorRAID1(
|
||||
* pair
|
||||
*/
|
||||
void
|
||||
rf_MapParityRAID1(
|
||||
RF_Raid_t * raidPtr,
|
||||
RF_RaidAddr_t raidSector,
|
||||
RF_RowCol_t * col,
|
||||
RF_SectorNum_t * diskSector,
|
||||
int remap)
|
||||
rf_MapParityRAID1(RF_Raid_t *raidPtr, RF_RaidAddr_t raidSector,
|
||||
RF_RowCol_t *col, RF_SectorNum_t *diskSector, int remap)
|
||||
{
|
||||
RF_StripeNum_t SUID = raidSector / raidPtr->Layout.sectorsPerStripeUnit;
|
||||
RF_RowCol_t mirrorPair = SUID % (raidPtr->numCol / 2);
|
||||
@ -139,10 +129,8 @@ rf_MapParityRAID1(
|
||||
* returns a list of disks for a given redundancy group
|
||||
*/
|
||||
void
|
||||
rf_IdentifyStripeRAID1(
|
||||
RF_Raid_t * raidPtr,
|
||||
RF_RaidAddr_t addr,
|
||||
RF_RowCol_t ** diskids)
|
||||
rf_IdentifyStripeRAID1(RF_Raid_t *raidPtr, RF_RaidAddr_t addr,
|
||||
RF_RowCol_t **diskids)
|
||||
{
|
||||
RF_StripeNum_t stripeID = rf_RaidAddressToStripeID(&raidPtr->Layout, addr);
|
||||
RF_Raid1ConfigInfo_t *info = raidPtr->Layout.layoutSpecificInfo;
|
||||
@ -158,11 +146,8 @@ rf_IdentifyStripeRAID1(
|
||||
* maps a logical stripe to a stripe in the redundant array
|
||||
*/
|
||||
void
|
||||
rf_MapSIDToPSIDRAID1(
|
||||
RF_RaidLayout_t * layoutPtr,
|
||||
RF_StripeNum_t stripeID,
|
||||
RF_StripeNum_t * psID,
|
||||
RF_ReconUnitNum_t * which_ru)
|
||||
rf_MapSIDToPSIDRAID1(RF_RaidLayout_t *layoutPtr, RF_StripeNum_t stripeID,
|
||||
RF_StripeNum_t *psID, RF_ReconUnitNum_t *which_ru)
|
||||
{
|
||||
*which_ru = 0;
|
||||
*psID = stripeID;
|
||||
@ -180,11 +165,8 @@ rf_MapSIDToPSIDRAID1(
|
||||
*****************************************************************************/
|
||||
|
||||
void
|
||||
rf_RAID1DagSelect(
|
||||
RF_Raid_t * raidPtr,
|
||||
RF_IoType_t type,
|
||||
RF_AccessStripeMap_t * asmap,
|
||||
RF_VoidFuncPtr * createFunc)
|
||||
rf_RAID1DagSelect(RF_Raid_t *raidPtr, RF_IoType_t type,
|
||||
RF_AccessStripeMap_t *asmap, RF_VoidFuncPtr *createFunc)
|
||||
{
|
||||
RF_RowCol_t fcol, oc;
|
||||
RF_PhysDiskAddr_t *failedPDA;
|
||||
@ -259,12 +241,9 @@ rf_RAID1DagSelect(
|
||||
}
|
||||
|
||||
int
|
||||
rf_VerifyParityRAID1(
|
||||
RF_Raid_t * raidPtr,
|
||||
RF_RaidAddr_t raidAddr,
|
||||
RF_PhysDiskAddr_t * parityPDA,
|
||||
int correct_it,
|
||||
RF_RaidAccessFlags_t flags)
|
||||
rf_VerifyParityRAID1(RF_Raid_t *raidPtr, RF_RaidAddr_t raidAddr,
|
||||
RF_PhysDiskAddr_t *parityPDA, int correct_it,
|
||||
RF_RaidAccessFlags_t flags)
|
||||
{
|
||||
int nbytes, bcount, stripeWidth, ret, i, j, nbad, *bbufs;
|
||||
RF_DagNode_t *blockNode, *wrBlock;
|
||||
@ -539,13 +518,14 @@ done:
|
||||
return (ret);
|
||||
}
|
||||
|
||||
/* rbuf - the recon buffer to submit
|
||||
* keep_it - whether we can keep this buffer or we have to return it
|
||||
* use_committed - whether to use a committed or an available recon buffer
|
||||
*/
|
||||
|
||||
int
|
||||
rf_SubmitReconBufferRAID1(rbuf, keep_it, use_committed)
|
||||
RF_ReconBuffer_t *rbuf; /* the recon buffer to submit */
|
||||
int keep_it; /* whether we can keep this buffer or we have
|
||||
* to return it */
|
||||
int use_committed; /* whether to use a committed or an available
|
||||
* recon buffer */
|
||||
rf_SubmitReconBufferRAID1(RF_ReconBuffer_t *rbuf, int keep_it,
|
||||
int use_committed)
|
||||
{
|
||||
RF_ReconParityStripeStatus_t *pssPtr;
|
||||
RF_ReconCtrl_t *reconCtrlPtr;
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: rf_raid4.c,v 1.7 2003/12/29 02:38:18 oster Exp $ */
|
||||
/* $NetBSD: rf_raid4.c,v 1.8 2003/12/30 21:59:03 oster Exp $ */
|
||||
/*
|
||||
* Copyright (c) 1995 Carnegie-Mellon University.
|
||||
* All rights reserved.
|
||||
@ -33,7 +33,7 @@
|
||||
***************************************/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: rf_raid4.c,v 1.7 2003/12/29 02:38:18 oster Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: rf_raid4.c,v 1.8 2003/12/30 21:59:03 oster Exp $");
|
||||
|
||||
#include "rf_raid.h"
|
||||
#include "rf_dag.h"
|
||||
@ -54,10 +54,8 @@ typedef struct RF_Raid4ConfigInfo_s {
|
||||
|
||||
|
||||
int
|
||||
rf_ConfigureRAID4(
|
||||
RF_ShutdownList_t ** listp,
|
||||
RF_Raid_t * raidPtr,
|
||||
RF_Config_t * cfgPtr)
|
||||
rf_ConfigureRAID4(RF_ShutdownList_t **listp, RF_Raid_t *raidPtr,
|
||||
RF_Config_t *cfgPtr)
|
||||
{
|
||||
RF_RaidLayout_t *layoutPtr = &raidPtr->Layout;
|
||||
RF_Raid4ConfigInfo_t *info;
|
||||
@ -87,24 +85,20 @@ rf_ConfigureRAID4(
|
||||
}
|
||||
|
||||
int
|
||||
rf_GetDefaultNumFloatingReconBuffersRAID4(RF_Raid_t * raidPtr)
|
||||
rf_GetDefaultNumFloatingReconBuffersRAID4(RF_Raid_t *raidPtr)
|
||||
{
|
||||
return (20);
|
||||
}
|
||||
|
||||
RF_HeadSepLimit_t
|
||||
rf_GetDefaultHeadSepLimitRAID4(RF_Raid_t * raidPtr)
|
||||
rf_GetDefaultHeadSepLimitRAID4(RF_Raid_t *raidPtr)
|
||||
{
|
||||
return (20);
|
||||
}
|
||||
|
||||
void
|
||||
rf_MapSectorRAID4(
|
||||
RF_Raid_t * raidPtr,
|
||||
RF_RaidAddr_t raidSector,
|
||||
RF_RowCol_t * col,
|
||||
RF_SectorNum_t * diskSector,
|
||||
int remap)
|
||||
rf_MapSectorRAID4(RF_Raid_t *raidPtr, RF_RaidAddr_t raidSector,
|
||||
RF_RowCol_t *col, RF_SectorNum_t *diskSector, int remap)
|
||||
{
|
||||
RF_StripeNum_t SUID = raidSector / raidPtr->Layout.sectorsPerStripeUnit;
|
||||
*col = SUID % raidPtr->Layout.numDataCol;
|
||||
@ -113,12 +107,8 @@ rf_MapSectorRAID4(
|
||||
}
|
||||
|
||||
void
|
||||
rf_MapParityRAID4(
|
||||
RF_Raid_t * raidPtr,
|
||||
RF_RaidAddr_t raidSector,
|
||||
RF_RowCol_t * col,
|
||||
RF_SectorNum_t * diskSector,
|
||||
int remap)
|
||||
rf_MapParityRAID4(RF_Raid_t *raidPtr, RF_RaidAddr_t raidSector,
|
||||
RF_RowCol_t *col, RF_SectorNum_t *diskSector, int remap)
|
||||
{
|
||||
RF_StripeNum_t SUID = raidSector / raidPtr->Layout.sectorsPerStripeUnit;
|
||||
|
||||
@ -128,10 +118,8 @@ rf_MapParityRAID4(
|
||||
}
|
||||
|
||||
void
|
||||
rf_IdentifyStripeRAID4(
|
||||
RF_Raid_t * raidPtr,
|
||||
RF_RaidAddr_t addr,
|
||||
RF_RowCol_t ** diskids)
|
||||
rf_IdentifyStripeRAID4(RF_Raid_t *raidPtr, RF_RaidAddr_t addr,
|
||||
RF_RowCol_t **diskids)
|
||||
{
|
||||
RF_Raid4ConfigInfo_t *info = raidPtr->Layout.layoutSpecificInfo;
|
||||
|
||||
@ -139,11 +127,8 @@ rf_IdentifyStripeRAID4(
|
||||
}
|
||||
|
||||
void
|
||||
rf_MapSIDToPSIDRAID4(
|
||||
RF_RaidLayout_t * layoutPtr,
|
||||
RF_StripeNum_t stripeID,
|
||||
RF_StripeNum_t * psID,
|
||||
RF_ReconUnitNum_t * which_ru)
|
||||
rf_MapSIDToPSIDRAID4(RF_RaidLayout_t *layoutPtr, RF_StripeNum_t stripeID,
|
||||
RF_StripeNum_t *psID, RF_ReconUnitNum_t *which_ru)
|
||||
{
|
||||
*which_ru = 0;
|
||||
*psID = stripeID;
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: rf_raid5.c,v 1.9 2003/12/29 02:38:18 oster Exp $ */
|
||||
/* $NetBSD: rf_raid5.c,v 1.10 2003/12/30 21:59:03 oster Exp $ */
|
||||
/*
|
||||
* Copyright (c) 1995 Carnegie-Mellon University.
|
||||
* All rights reserved.
|
||||
@ -33,7 +33,7 @@
|
||||
*****************************************************************************/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: rf_raid5.c,v 1.9 2003/12/29 02:38:18 oster Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: rf_raid5.c,v 1.10 2003/12/30 21:59:03 oster Exp $");
|
||||
|
||||
#include <dev/raidframe/raidframevar.h>
|
||||
|
||||
@ -55,10 +55,8 @@ typedef struct RF_Raid5ConfigInfo_s {
|
||||
} RF_Raid5ConfigInfo_t;
|
||||
|
||||
int
|
||||
rf_ConfigureRAID5(
|
||||
RF_ShutdownList_t ** listp,
|
||||
RF_Raid_t * raidPtr,
|
||||
RF_Config_t * cfgPtr)
|
||||
rf_ConfigureRAID5(RF_ShutdownList_t **listp, RF_Raid_t *raidPtr,
|
||||
RF_Config_t *cfgPtr)
|
||||
{
|
||||
RF_RaidLayout_t *layoutPtr = &raidPtr->Layout;
|
||||
RF_Raid5ConfigInfo_t *info;
|
||||
@ -97,32 +95,28 @@ rf_ConfigureRAID5(
|
||||
}
|
||||
|
||||
int
|
||||
rf_GetDefaultNumFloatingReconBuffersRAID5(RF_Raid_t * raidPtr)
|
||||
rf_GetDefaultNumFloatingReconBuffersRAID5(RF_Raid_t *raidPtr)
|
||||
{
|
||||
return (20);
|
||||
}
|
||||
|
||||
RF_HeadSepLimit_t
|
||||
rf_GetDefaultHeadSepLimitRAID5(RF_Raid_t * raidPtr)
|
||||
rf_GetDefaultHeadSepLimitRAID5(RF_Raid_t *raidPtr)
|
||||
{
|
||||
return (10);
|
||||
}
|
||||
#if !defined(__NetBSD__) && !defined(_KERNEL)
|
||||
/* not currently used */
|
||||
int
|
||||
rf_ShutdownRAID5(RF_Raid_t * raidPtr)
|
||||
rf_ShutdownRAID5(RF_Raid_t *raidPtr)
|
||||
{
|
||||
return (0);
|
||||
}
|
||||
#endif
|
||||
|
||||
void
|
||||
rf_MapSectorRAID5(
|
||||
RF_Raid_t * raidPtr,
|
||||
RF_RaidAddr_t raidSector,
|
||||
RF_RowCol_t * col,
|
||||
RF_SectorNum_t * diskSector,
|
||||
int remap)
|
||||
rf_MapSectorRAID5(RF_Raid_t *raidPtr, RF_RaidAddr_t raidSector,
|
||||
RF_RowCol_t *col, RF_SectorNum_t *diskSector, int remap)
|
||||
{
|
||||
RF_StripeNum_t SUID = raidSector / raidPtr->Layout.sectorsPerStripeUnit;
|
||||
*col = (SUID % raidPtr->numCol);
|
||||
@ -131,12 +125,8 @@ rf_MapSectorRAID5(
|
||||
}
|
||||
|
||||
void
|
||||
rf_MapParityRAID5(
|
||||
RF_Raid_t * raidPtr,
|
||||
RF_RaidAddr_t raidSector,
|
||||
RF_RowCol_t * col,
|
||||
RF_SectorNum_t * diskSector,
|
||||
int remap)
|
||||
rf_MapParityRAID5(RF_Raid_t *raidPtr, RF_RaidAddr_t raidSector,
|
||||
RF_RowCol_t *col, RF_SectorNum_t *diskSector, int remap)
|
||||
{
|
||||
RF_StripeNum_t SUID = raidSector / raidPtr->Layout.sectorsPerStripeUnit;
|
||||
|
||||
@ -146,10 +136,8 @@ rf_MapParityRAID5(
|
||||
}
|
||||
|
||||
void
|
||||
rf_IdentifyStripeRAID5(
|
||||
RF_Raid_t * raidPtr,
|
||||
RF_RaidAddr_t addr,
|
||||
RF_RowCol_t ** diskids)
|
||||
rf_IdentifyStripeRAID5(RF_Raid_t *raidPtr, RF_RaidAddr_t addr,
|
||||
RF_RowCol_t **diskids)
|
||||
{
|
||||
RF_StripeNum_t stripeID = rf_RaidAddressToStripeID(&raidPtr->Layout, addr);
|
||||
RF_Raid5ConfigInfo_t *info = (RF_Raid5ConfigInfo_t *) raidPtr->Layout.layoutSpecificInfo;
|
||||
@ -158,11 +146,8 @@ rf_IdentifyStripeRAID5(
|
||||
}
|
||||
|
||||
void
|
||||
rf_MapSIDToPSIDRAID5(
|
||||
RF_RaidLayout_t * layoutPtr,
|
||||
RF_StripeNum_t stripeID,
|
||||
RF_StripeNum_t * psID,
|
||||
RF_ReconUnitNum_t * which_ru)
|
||||
rf_MapSIDToPSIDRAID5(RF_RaidLayout_t *layoutPtr, RF_StripeNum_t stripeID,
|
||||
RF_StripeNum_t *psID, RF_ReconUnitNum_t *which_ru)
|
||||
{
|
||||
*which_ru = 0;
|
||||
*psID = stripeID;
|
||||
@ -172,11 +157,9 @@ rf_MapSIDToPSIDRAID5(
|
||||
* another to a function that will create the dag.
|
||||
*/
|
||||
void
|
||||
rf_RaidFiveDagSelect(
|
||||
RF_Raid_t * raidPtr,
|
||||
RF_IoType_t type,
|
||||
RF_AccessStripeMap_t * asmap,
|
||||
RF_VoidFuncPtr * createFunc)
|
||||
rf_RaidFiveDagSelect(RF_Raid_t *raidPtr, RF_IoType_t type,
|
||||
RF_AccessStripeMap_t *asmap,
|
||||
RF_VoidFuncPtr *createFunc)
|
||||
{
|
||||
RF_RaidLayout_t *layoutPtr = &(raidPtr->Layout);
|
||||
RF_PhysDiskAddr_t *failedPDA = NULL;
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: rf_reconbuffer.c,v 1.14 2003/12/29 02:38:18 oster Exp $ */
|
||||
/* $NetBSD: rf_reconbuffer.c,v 1.15 2003/12/30 21:59:03 oster 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.14 2003/12/29 02:38:18 oster Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: rf_reconbuffer.c,v 1.15 2003/12/30 21:59:03 oster Exp $");
|
||||
|
||||
#include "rf_raid.h"
|
||||
#include "rf_reconbuffer.h"
|
||||
@ -94,13 +94,13 @@ static const RF_VoidFuncPtr nWayXorFuncs[] = {
|
||||
(RF_VoidFuncPtr) rf_nWayXor9
|
||||
};
|
||||
|
||||
/*
|
||||
* rbuf - the recon buffer to submit
|
||||
* keep_it - whether we can keep this buffer or we have to return it
|
||||
* use_committed - whether to use a committed or an available recon buffer
|
||||
*/
|
||||
int
|
||||
rf_SubmitReconBuffer(rbuf, keep_it, use_committed)
|
||||
RF_ReconBuffer_t *rbuf; /* the recon buffer to submit */
|
||||
int keep_it; /* whether we can keep this buffer or we have
|
||||
* to return it */
|
||||
int use_committed; /* whether to use a committed or an available
|
||||
* recon buffer */
|
||||
rf_SubmitReconBuffer(RF_ReconBuffer_t *rbuf, int keep_it, int use_committed)
|
||||
{
|
||||
const RF_LayoutSW_t *lp;
|
||||
int rc;
|
||||
@ -110,13 +110,14 @@ rf_SubmitReconBuffer(rbuf, keep_it, use_committed)
|
||||
return (rc);
|
||||
}
|
||||
|
||||
/*
|
||||
* rbuf - the recon buffer to submit
|
||||
* keep_it - whether we can keep this buffer or we have to return it
|
||||
* use_committed - whether to use a committed or an available recon buffer
|
||||
*/
|
||||
int
|
||||
rf_SubmitReconBufferBasic(rbuf, keep_it, use_committed)
|
||||
RF_ReconBuffer_t *rbuf; /* the recon buffer to submit */
|
||||
int keep_it; /* whether we can keep this buffer or we have
|
||||
* to return it */
|
||||
int use_committed; /* whether to use a committed or an available
|
||||
* recon buffer */
|
||||
rf_SubmitReconBufferBasic(RF_ReconBuffer_t *rbuf, int keep_it,
|
||||
int use_committed)
|
||||
{
|
||||
RF_Raid_t *raidPtr = rbuf->raidPtr;
|
||||
RF_RaidLayout_t *layoutPtr = &raidPtr->Layout;
|
||||
@ -280,12 +281,9 @@ out:
|
||||
RF_UNLOCK_MUTEX(reconCtrlPtr->rb_mutex);
|
||||
return (retcode);
|
||||
}
|
||||
|
||||
/* pssPtr - the pss descriptor for this parity stripe */
|
||||
int
|
||||
rf_MultiWayReconXor(raidPtr, pssPtr)
|
||||
RF_Raid_t *raidPtr;
|
||||
RF_ReconParityStripeStatus_t *pssPtr; /* the pss descriptor for this
|
||||
* parity stripe */
|
||||
rf_MultiWayReconXor(RF_Raid_t *raidPtr, RF_ReconParityStripeStatus_t *pssPtr)
|
||||
{
|
||||
int i, numBufs = pssPtr->xorBufCount;
|
||||
int numBytes = rf_RaidAddressToByte(raidPtr, raidPtr->Layout.sectorsPerStripeUnit * raidPtr->Layout.SUsPerRU);
|
||||
@ -326,8 +324,7 @@ rf_MultiWayReconXor(raidPtr, pssPtr)
|
||||
* ASSUMES THE RB_MUTEX IS UNLOCKED AT ENTRY.
|
||||
*/
|
||||
RF_ReconBuffer_t *
|
||||
rf_GetFullReconBuffer(reconCtrlPtr)
|
||||
RF_ReconCtrl_t *reconCtrlPtr;
|
||||
rf_GetFullReconBuffer(RF_ReconCtrl_t *reconCtrlPtr)
|
||||
{
|
||||
RF_ReconBuffer_t *p;
|
||||
|
||||
@ -347,11 +344,8 @@ rf_GetFullReconBuffer(reconCtrlPtr)
|
||||
*
|
||||
* ASSUMES THE RB_MUTEX IS LOCKED AT ENTRY. */
|
||||
int
|
||||
rf_CheckForFullRbuf(raidPtr, reconCtrl, pssPtr, numDataCol)
|
||||
RF_Raid_t *raidPtr;
|
||||
RF_ReconCtrl_t *reconCtrl;
|
||||
RF_ReconParityStripeStatus_t *pssPtr;
|
||||
int numDataCol;
|
||||
rf_CheckForFullRbuf(RF_Raid_t *raidPtr, RF_ReconCtrl_t *reconCtrl,
|
||||
RF_ReconParityStripeStatus_t *pssPtr, int numDataCol)
|
||||
{
|
||||
RF_ReconBuffer_t *p, *pt, *rbuf = (RF_ReconBuffer_t *) pssPtr->rbuf;
|
||||
|
||||
@ -383,9 +377,7 @@ rf_CheckForFullRbuf(raidPtr, reconCtrl, pssPtr, numDataCol)
|
||||
* assumes the rb_mutex is LOCKED at entry
|
||||
*/
|
||||
void
|
||||
rf_ReleaseFloatingReconBuffer(raidPtr, rbuf)
|
||||
RF_Raid_t *raidPtr;
|
||||
RF_ReconBuffer_t *rbuf;
|
||||
rf_ReleaseFloatingReconBuffer(RF_Raid_t *raidPtr, RF_ReconBuffer_t *rbuf)
|
||||
{
|
||||
RF_ReconCtrl_t *rcPtr = raidPtr->reconControl;
|
||||
RF_CallbackDesc_t *cb;
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: rf_reconmap.c,v 1.21 2003/12/29 05:01:14 oster Exp $ */
|
||||
/* $NetBSD: rf_reconmap.c,v 1.22 2003/12/30 21:59:03 oster Exp $ */
|
||||
/*
|
||||
* Copyright (c) 1995 Carnegie-Mellon University.
|
||||
* All rights reserved.
|
||||
@ -34,7 +34,7 @@
|
||||
*************************************************************************/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: rf_reconmap.c,v 1.21 2003/12/29 05:01:14 oster Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: rf_reconmap.c,v 1.22 2003/12/30 21:59:03 oster Exp $");
|
||||
|
||||
#include "rf_raid.h"
|
||||
#include <sys/time.h>
|
||||
@ -78,16 +78,15 @@ static void PrintList(RF_ReconMapListElem_t * listPtr);
|
||||
*
|
||||
* Creates and initializes new Reconstruction map
|
||||
*
|
||||
* ru_sectors - size of reconstruction unit in sectors
|
||||
* disk_sectors - size of disk in sectors
|
||||
* spareUnitsPerDisk - zero unless distributed sparing
|
||||
*-------------------------------------------------------------------------*/
|
||||
|
||||
RF_ReconMap_t *
|
||||
rf_MakeReconMap(raidPtr, ru_sectors, disk_sectors, spareUnitsPerDisk)
|
||||
RF_Raid_t *raidPtr;
|
||||
RF_SectorCount_t ru_sectors; /* size of reconstruction unit in
|
||||
* sectors */
|
||||
RF_SectorCount_t disk_sectors; /* size of disk in sectors */
|
||||
RF_ReconUnitCount_t spareUnitsPerDisk; /* zero unless distributed
|
||||
* sparing */
|
||||
rf_MakeReconMap(RF_Raid_t *raidPtr, RF_SectorCount_t ru_sectors,
|
||||
RF_SectorCount_t disk_sectors,
|
||||
RF_ReconUnitCount_t spareUnitsPerDisk)
|
||||
{
|
||||
RF_RaidLayout_t *layoutPtr = &raidPtr->Layout;
|
||||
RF_ReconUnitCount_t num_rus = layoutPtr->stripeUnitsPerDisk / layoutPtr->SUsPerRU;
|
||||
@ -135,11 +134,8 @@ rf_MakeReconMap(raidPtr, ru_sectors, disk_sectors, spareUnitsPerDisk)
|
||||
*-------------------------------------------------------------------------*/
|
||||
|
||||
void
|
||||
rf_ReconMapUpdate(raidPtr, mapPtr, startSector, stopSector)
|
||||
RF_Raid_t *raidPtr;
|
||||
RF_ReconMap_t *mapPtr;
|
||||
RF_SectorNum_t startSector;
|
||||
RF_SectorNum_t stopSector;
|
||||
rf_ReconMapUpdate(RF_Raid_t *raidPtr, RF_ReconMap_t *mapPtr,
|
||||
RF_SectorNum_t startSector, RF_SectorNum_t stopSector)
|
||||
{
|
||||
RF_SectorCount_t sectorsPerReconUnit = mapPtr->sectorsPerReconUnit;
|
||||
RF_SectorNum_t i, first_in_RU, last_in_RU;
|
||||
@ -196,10 +192,7 @@ rf_ReconMapUpdate(raidPtr, mapPtr, startSector, stopSector)
|
||||
*-------------------------------------------------------------------------*/
|
||||
|
||||
static void
|
||||
compact_stat_entry(raidPtr, mapPtr, i)
|
||||
RF_Raid_t *raidPtr;
|
||||
RF_ReconMap_t *mapPtr;
|
||||
int i;
|
||||
compact_stat_entry(RF_Raid_t *raidPtr, RF_ReconMap_t *mapPtr, int i)
|
||||
{
|
||||
RF_SectorCount_t sectorsPerReconUnit = mapPtr->sectorsPerReconUnit;
|
||||
RF_ReconMapListElem_t *p = mapPtr->status[i];
|
||||
@ -216,9 +209,7 @@ compact_stat_entry(raidPtr, mapPtr, i)
|
||||
}
|
||||
|
||||
static void
|
||||
crunch_list(mapPtr, listPtr)
|
||||
RF_ReconMap_t *mapPtr;
|
||||
RF_ReconMapListElem_t *listPtr;
|
||||
crunch_list(RF_ReconMap_t *mapPtr, RF_ReconMapListElem_t *listPtr)
|
||||
{
|
||||
RF_ReconMapListElem_t *pt, *p = listPtr;
|
||||
|
||||
@ -245,11 +236,8 @@ crunch_list(mapPtr, listPtr)
|
||||
*-------------------------------------------------------------------------*/
|
||||
|
||||
static RF_ReconMapListElem_t *
|
||||
MakeReconMapListElem(
|
||||
RF_ReconMap_t *mapPtr,
|
||||
RF_SectorNum_t startSector,
|
||||
RF_SectorNum_t stopSector,
|
||||
RF_ReconMapListElem_t * next)
|
||||
MakeReconMapListElem(RF_ReconMap_t *mapPtr, RF_SectorNum_t startSector,
|
||||
RF_SectorNum_t stopSector, RF_ReconMapListElem_t *next)
|
||||
{
|
||||
RF_ReconMapListElem_t *p;
|
||||
|
||||
@ -270,9 +258,7 @@ MakeReconMapListElem(
|
||||
*-------------------------------------------------------------------------*/
|
||||
|
||||
static void
|
||||
FreeReconMapListElem(mapPtr, p)
|
||||
RF_ReconMap_t *mapPtr;
|
||||
RF_ReconMapListElem_t *p;
|
||||
FreeReconMapListElem(RF_ReconMap_t *mapPtr, RF_ReconMapListElem_t *p)
|
||||
{
|
||||
pool_put(&mapPtr->elem_pool, p);
|
||||
}
|
||||
@ -283,8 +269,7 @@ FreeReconMapListElem(mapPtr, p)
|
||||
*
|
||||
*-------------------------------------------------------------------------*/
|
||||
void
|
||||
rf_FreeReconMap(mapPtr)
|
||||
RF_ReconMap_t *mapPtr;
|
||||
rf_FreeReconMap(RF_ReconMap_t *mapPtr)
|
||||
{
|
||||
RF_ReconMapListElem_t *p, *q;
|
||||
RF_ReconUnitCount_t numRUs;
|
||||
@ -314,9 +299,7 @@ rf_FreeReconMap(mapPtr)
|
||||
*-------------------------------------------------------------------------*/
|
||||
|
||||
int
|
||||
rf_CheckRUReconstructed(mapPtr, startSector)
|
||||
RF_ReconMap_t *mapPtr;
|
||||
RF_SectorNum_t startSector;
|
||||
rf_CheckRUReconstructed(RF_ReconMap_t *mapPtr, RF_SectorNum_t startSector)
|
||||
{
|
||||
RF_ReconMapListElem_t *l; /* used for searching */
|
||||
RF_ReconUnitNum_t i;
|
||||
@ -327,8 +310,7 @@ rf_CheckRUReconstructed(mapPtr, startSector)
|
||||
}
|
||||
|
||||
RF_ReconUnitCount_t
|
||||
rf_UnitsLeftToReconstruct(mapPtr)
|
||||
RF_ReconMap_t *mapPtr;
|
||||
rf_UnitsLeftToReconstruct(RF_ReconMap_t *mapPtr)
|
||||
{
|
||||
RF_ASSERT(mapPtr != NULL);
|
||||
return (mapPtr->unitsLeft);
|
||||
@ -336,8 +318,7 @@ rf_UnitsLeftToReconstruct(mapPtr)
|
||||
|
||||
#if 0
|
||||
static void
|
||||
PrintList(listPtr)
|
||||
RF_ReconMapListElem_t *listPtr;
|
||||
PrintList(RF_ReconMapListElem_t *listPtr)
|
||||
{
|
||||
while (listPtr) {
|
||||
printf("%d,%d -> ", (int) listPtr->startSector,
|
||||
@ -348,10 +329,7 @@ PrintList(listPtr)
|
||||
}
|
||||
|
||||
void
|
||||
rf_PrintReconMap(raidPtr, mapPtr, fcol)
|
||||
RF_Raid_t *raidPtr;
|
||||
RF_ReconMap_t *mapPtr;
|
||||
RF_RowCol_t fcol;
|
||||
rf_PrintReconMap(RF_Raid_t *raidPtr, RF_ReconMap_t *mapPtr, RF_RowCol_t fcol)
|
||||
{
|
||||
RF_ReconUnitCount_t numRUs;
|
||||
RF_ReconMapListElem_t *p;
|
||||
@ -378,9 +356,7 @@ rf_PrintReconMap(raidPtr, mapPtr, fcol)
|
||||
|
||||
#if RF_DEBUG_RECON
|
||||
void
|
||||
rf_PrintReconSchedule(mapPtr, starttime)
|
||||
RF_ReconMap_t *mapPtr;
|
||||
struct timeval *starttime;
|
||||
rf_PrintReconSchedule(RF_ReconMap_t *mapPtr, struct timeval *starttime)
|
||||
{
|
||||
static int old_pctg = -1;
|
||||
struct timeval tv, diff;
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: rf_reconstruct.c,v 1.59 2003/12/29 05:58:34 oster Exp $ */
|
||||
/* $NetBSD: rf_reconstruct.c,v 1.60 2003/12/30 21:59:03 oster 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.59 2003/12/29 05:58:34 oster Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: rf_reconstruct.c,v 1.60 2003/12/30 21:59:03 oster Exp $");
|
||||
|
||||
#include <sys/time.h>
|
||||
#include <sys/buf.h>
|
||||
@ -148,15 +148,13 @@ struct RF_ReconDoneProc_s {
|
||||
*
|
||||
**************************************************************************/
|
||||
static void
|
||||
rf_ShutdownReconstruction(ignored)
|
||||
void *ignored;
|
||||
rf_ShutdownReconstruction(void *ignored)
|
||||
{
|
||||
pool_destroy(&rf_recond_pool);
|
||||
}
|
||||
|
||||
int
|
||||
rf_ConfigureReconstruction(listp)
|
||||
RF_ShutdownList_t **listp;
|
||||
rf_ConfigureReconstruction(RF_ShutdownList_t **listp)
|
||||
{
|
||||
int rc;
|
||||
|
||||
@ -172,12 +170,9 @@ rf_ConfigureReconstruction(listp)
|
||||
}
|
||||
|
||||
static RF_RaidReconDesc_t *
|
||||
AllocRaidReconDesc(raidPtr, col, spareDiskPtr, numDisksDone, scol)
|
||||
RF_Raid_t *raidPtr;
|
||||
RF_RowCol_t col;
|
||||
RF_RaidDisk_t *spareDiskPtr;
|
||||
int numDisksDone;
|
||||
RF_RowCol_t scol;
|
||||
AllocRaidReconDesc(RF_Raid_t *raidPtr, RF_RowCol_t col,
|
||||
RF_RaidDisk_t *spareDiskPtr, int numDisksDone,
|
||||
RF_RowCol_t scol)
|
||||
{
|
||||
|
||||
RF_RaidReconDesc_t *reconDesc;
|
||||
@ -196,8 +191,7 @@ AllocRaidReconDesc(raidPtr, col, spareDiskPtr, numDisksDone, scol)
|
||||
}
|
||||
|
||||
static void
|
||||
FreeReconDesc(reconDesc)
|
||||
RF_RaidReconDesc_t *reconDesc;
|
||||
FreeReconDesc(RF_RaidReconDesc_t *reconDesc)
|
||||
{
|
||||
#if RF_RECON_STATS > 0
|
||||
printf("raid%d: %lu recon event waits, %lu recon delays\n",
|
||||
@ -222,9 +216,7 @@ FreeReconDesc(reconDesc)
|
||||
* fails, or is aborted.
|
||||
*****************************************************************************/
|
||||
int
|
||||
rf_ReconstructFailedDisk(raidPtr, col)
|
||||
RF_Raid_t *raidPtr;
|
||||
RF_RowCol_t col;
|
||||
rf_ReconstructFailedDisk(RF_Raid_t *raidPtr, RF_RowCol_t col)
|
||||
{
|
||||
const RF_LayoutSW_t *lp;
|
||||
int rc;
|
||||
@ -255,9 +247,7 @@ rf_ReconstructFailedDisk(raidPtr, col)
|
||||
}
|
||||
|
||||
int
|
||||
rf_ReconstructFailedDiskBasic(raidPtr, col)
|
||||
RF_Raid_t *raidPtr;
|
||||
RF_RowCol_t col;
|
||||
rf_ReconstructFailedDiskBasic(RF_Raid_t *raidPtr, RF_RowCol_t col)
|
||||
{
|
||||
RF_ComponentLabel_t c_label;
|
||||
RF_RaidDisk_t *spareDiskPtr = NULL;
|
||||
@ -359,9 +349,7 @@ rf_ReconstructFailedDiskBasic(raidPtr, col)
|
||||
*/
|
||||
|
||||
int
|
||||
rf_ReconstructInPlace(raidPtr, col)
|
||||
RF_Raid_t *raidPtr;
|
||||
RF_RowCol_t col;
|
||||
rf_ReconstructInPlace(RF_Raid_t *raidPtr, RF_RowCol_t col)
|
||||
{
|
||||
RF_RaidDisk_t *spareDiskPtr = NULL;
|
||||
RF_RaidReconDesc_t *reconDesc;
|
||||
@ -575,8 +563,7 @@ rf_ReconstructInPlace(raidPtr, col)
|
||||
|
||||
|
||||
int
|
||||
rf_ContinueReconstructFailedDisk(reconDesc)
|
||||
RF_RaidReconDesc_t *reconDesc;
|
||||
rf_ContinueReconstructFailedDisk(RF_RaidReconDesc_t *reconDesc)
|
||||
{
|
||||
RF_Raid_t *raidPtr = reconDesc->raidPtr;
|
||||
RF_RowCol_t col = reconDesc->col;
|
||||
@ -779,9 +766,7 @@ rf_ContinueReconstructFailedDisk(reconDesc)
|
||||
* indicated disk
|
||||
*****************************************************************************/
|
||||
static int
|
||||
ProcessReconEvent(raidPtr, event)
|
||||
RF_Raid_t *raidPtr;
|
||||
RF_ReconEvent_t *event;
|
||||
ProcessReconEvent(RF_Raid_t *raidPtr, RF_ReconEvent_t *event)
|
||||
{
|
||||
int retcode = 0, submitblocked;
|
||||
RF_ReconBuffer_t *rbuf;
|
||||
@ -912,9 +897,7 @@ ProcessReconEvent(raidPtr, event)
|
||||
*
|
||||
*****************************************************************************/
|
||||
static int
|
||||
IssueNextReadRequest(raidPtr, col)
|
||||
RF_Raid_t *raidPtr;
|
||||
RF_RowCol_t col;
|
||||
IssueNextReadRequest(RF_Raid_t *raidPtr, RF_RowCol_t col)
|
||||
{
|
||||
RF_PerDiskReconCtrl_t *ctrl = &raidPtr->reconControl->perDiskInfo[col];
|
||||
RF_RaidLayout_t *layoutPtr = &raidPtr->Layout;
|
||||
@ -990,9 +973,7 @@ IssueNextReadRequest(raidPtr, col)
|
||||
*/
|
||||
|
||||
static int
|
||||
TryToRead(raidPtr, col)
|
||||
RF_Raid_t *raidPtr;
|
||||
RF_RowCol_t col;
|
||||
TryToRead(RF_Raid_t *raidPtr, RF_RowCol_t col)
|
||||
{
|
||||
RF_PerDiskReconCtrl_t *ctrl = &raidPtr->reconControl->perDiskInfo[col];
|
||||
RF_SectorCount_t sectorsPerRU = raidPtr->Layout.sectorsPerStripeUnit * raidPtr->Layout.SUsPerRU;
|
||||
@ -1083,19 +1064,23 @@ out:
|
||||
* since the calls to the mapping module are kept to a minimum.
|
||||
*
|
||||
* ASSUMES THAT THE STRIPE IDENTIFIER IDENTIFIES THE DISKS COMPRISING
|
||||
* THE STRIPE IN THE CORRECT ORDER */
|
||||
* THE STRIPE IN THE CORRECT ORDER
|
||||
*
|
||||
* raidPtr - raid descriptor
|
||||
* psid - parity stripe identifier
|
||||
* col - column of disk to find the offsets for
|
||||
* spCol - out: col of spare unit for failed unit
|
||||
* spOffset - out: offset into disk containing spare unit
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
static int
|
||||
ComputePSDiskOffsets(
|
||||
RF_Raid_t * raidPtr, /* raid descriptor */
|
||||
RF_StripeNum_t psid, /* parity stripe identifier */
|
||||
RF_RowCol_t col, /* column of disk to find the offsets for */
|
||||
RF_SectorNum_t * outDiskOffset,
|
||||
RF_SectorNum_t * outFailedDiskSectorOffset,
|
||||
RF_RowCol_t * spCol, /* OUT: col of spare unit for failed unit */
|
||||
RF_SectorNum_t * spOffset)
|
||||
{ /* OUT: offset into disk containing spare unit */
|
||||
ComputePSDiskOffsets(RF_Raid_t *raidPtr, RF_StripeNum_t psid,
|
||||
RF_RowCol_t col, RF_SectorNum_t *outDiskOffset,
|
||||
RF_SectorNum_t *outFailedDiskSectorOffset,
|
||||
RF_RowCol_t *spCol, RF_SectorNum_t *spOffset)
|
||||
{
|
||||
RF_RaidLayout_t *layoutPtr = &raidPtr->Layout;
|
||||
RF_RowCol_t fcol = raidPtr->reconControl->fcol;
|
||||
RF_RaidAddr_t sosRaidAddress; /* start-of-stripe */
|
||||
@ -1194,8 +1179,7 @@ skipit:
|
||||
}
|
||||
/* this is called when a buffer has become ready to write to the replacement disk */
|
||||
static int
|
||||
IssueNextWriteRequest(raidPtr)
|
||||
RF_Raid_t *raidPtr;
|
||||
IssueNextWriteRequest(RF_Raid_t *raidPtr)
|
||||
{
|
||||
RF_RaidLayout_t *layoutPtr = &raidPtr->Layout;
|
||||
RF_SectorCount_t sectorsPerRU = layoutPtr->sectorsPerStripeUnit * layoutPtr->SUsPerRU;
|
||||
@ -1244,9 +1228,7 @@ IssueNextWriteRequest(raidPtr)
|
||||
* illegal here.
|
||||
*/
|
||||
static int
|
||||
ReconReadDoneProc(arg, status)
|
||||
void *arg;
|
||||
int status;
|
||||
ReconReadDoneProc(void *arg, int status)
|
||||
{
|
||||
RF_PerDiskReconCtrl_t *ctrl = (RF_PerDiskReconCtrl_t *) arg;
|
||||
RF_Raid_t *raidPtr = ctrl->reconCtrl->reconDesc->raidPtr;
|
||||
@ -1273,9 +1255,7 @@ ReconReadDoneProc(arg, status)
|
||||
* called at interrupt context in the kernel, so don't do anything illegal here.
|
||||
*/
|
||||
static int
|
||||
ReconWriteDoneProc(arg, status)
|
||||
void *arg;
|
||||
int status;
|
||||
ReconWriteDoneProc(void *arg, int status)
|
||||
{
|
||||
RF_ReconBuffer_t *rbuf = (RF_ReconBuffer_t *) arg;
|
||||
|
||||
@ -1295,9 +1275,7 @@ ReconWriteDoneProc(arg, status)
|
||||
* be woken as a result
|
||||
*/
|
||||
static void
|
||||
CheckForNewMinHeadSep(raidPtr, hsCtr)
|
||||
RF_Raid_t *raidPtr;
|
||||
RF_HeadSepLimit_t hsCtr;
|
||||
CheckForNewMinHeadSep(RF_Raid_t *raidPtr, RF_HeadSepLimit_t hsCtr)
|
||||
{
|
||||
RF_ReconCtrl_t *reconCtrlPtr = raidPtr->reconControl;
|
||||
RF_HeadSepLimit_t new_min;
|
||||
@ -1346,12 +1324,9 @@ CheckForNewMinHeadSep(raidPtr, hsCtr)
|
||||
* indicated disk due to a head-separation delay.
|
||||
*/
|
||||
static int
|
||||
CheckHeadSeparation(
|
||||
RF_Raid_t * raidPtr,
|
||||
RF_PerDiskReconCtrl_t * ctrl,
|
||||
RF_RowCol_t col,
|
||||
RF_HeadSepLimit_t hsCtr,
|
||||
RF_ReconUnitNum_t which_ru)
|
||||
CheckHeadSeparation(RF_Raid_t *raidPtr, RF_PerDiskReconCtrl_t *ctrl,
|
||||
RF_RowCol_t col, RF_HeadSepLimit_t hsCtr,
|
||||
RF_ReconUnitNum_t which_ru)
|
||||
{
|
||||
RF_ReconCtrl_t *reconCtrlPtr = raidPtr->reconControl;
|
||||
RF_CallbackDesc_t *cb, *p, *pt;
|
||||
@ -1410,13 +1385,11 @@ CheckHeadSeparation(
|
||||
* ASSUMES THE PSS MUTEX IS LOCKED UPON ENTRY
|
||||
*/
|
||||
static int
|
||||
CheckForcedOrBlockedReconstruction(
|
||||
RF_Raid_t * raidPtr,
|
||||
RF_ReconParityStripeStatus_t * pssPtr,
|
||||
RF_PerDiskReconCtrl_t * ctrl,
|
||||
RF_RowCol_t col,
|
||||
RF_StripeNum_t psid,
|
||||
RF_ReconUnitNum_t which_ru)
|
||||
CheckForcedOrBlockedReconstruction(RF_Raid_t *raidPtr,
|
||||
RF_ReconParityStripeStatus_t *pssPtr,
|
||||
RF_PerDiskReconCtrl_t *ctrl,
|
||||
RF_RowCol_t col, RF_StripeNum_t psid,
|
||||
RF_ReconUnitNum_t which_ru)
|
||||
{
|
||||
RF_CallbackDesc_t *cb;
|
||||
int retcode = 0;
|
||||
@ -1449,11 +1422,8 @@ CheckForcedOrBlockedReconstruction(
|
||||
* invoked with the cbArg when the reconstruction has completed.
|
||||
*/
|
||||
int
|
||||
rf_ForceOrBlockRecon(raidPtr, asmap, cbFunc, cbArg)
|
||||
RF_Raid_t *raidPtr;
|
||||
RF_AccessStripeMap_t *asmap;
|
||||
void (*cbFunc) (RF_Raid_t *, void *);
|
||||
void *cbArg;
|
||||
rf_ForceOrBlockRecon(RF_Raid_t *raidPtr, RF_AccessStripeMap_t *asmap,
|
||||
void (*cbFunc)(RF_Raid_t *, void *), void *cbArg)
|
||||
{
|
||||
RF_StripeNum_t stripeID = asmap->stripeID; /* the stripe ID we're
|
||||
* forcing recon on */
|
||||
@ -1560,9 +1530,7 @@ rf_ForceOrBlockRecon(raidPtr, asmap, cbFunc, cbArg)
|
||||
* called at interrupt context in the kernel, so don't do anything illegal here.
|
||||
*/
|
||||
static void
|
||||
ForceReconReadDoneProc(arg, status)
|
||||
void *arg;
|
||||
int status;
|
||||
ForceReconReadDoneProc(void *arg, int status)
|
||||
{
|
||||
RF_ReconBuffer_t *rbuf = arg;
|
||||
|
||||
@ -1576,9 +1544,7 @@ ForceReconReadDoneProc(arg, status)
|
||||
}
|
||||
/* releases a block on the reconstruction of the indicated stripe */
|
||||
int
|
||||
rf_UnblockRecon(raidPtr, asmap)
|
||||
RF_Raid_t *raidPtr;
|
||||
RF_AccessStripeMap_t *asmap;
|
||||
rf_UnblockRecon(RF_Raid_t *raidPtr, RF_AccessStripeMap_t *asmap)
|
||||
{
|
||||
RF_StripeNum_t stripeID = asmap->stripeID;
|
||||
RF_ReconParityStripeStatus_t *pssPtr;
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: rf_reconutil.c,v 1.18 2003/12/29 05:01:14 oster Exp $ */
|
||||
/* $NetBSD: rf_reconutil.c,v 1.19 2003/12/30 21:59:03 oster 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.18 2003/12/29 05:01:14 oster Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: rf_reconutil.c,v 1.19 2003/12/30 21:59:03 oster Exp $");
|
||||
|
||||
#include <dev/raidframe/raidframevar.h>
|
||||
|
||||
@ -48,11 +48,14 @@ __KERNEL_RCSID(0, "$NetBSD: rf_reconutil.c,v 1.18 2003/12/29 05:01:14 oster Exp
|
||||
/*******************************************************************
|
||||
* allocates/frees the reconstruction control information structures
|
||||
*******************************************************************/
|
||||
|
||||
/* fcol - failed column
|
||||
* scol - identifies which spare we are using
|
||||
*/
|
||||
|
||||
RF_ReconCtrl_t *
|
||||
rf_MakeReconControl(reconDesc, fcol, scol)
|
||||
RF_RaidReconDesc_t *reconDesc;
|
||||
RF_RowCol_t fcol; /* failed column */
|
||||
RF_RowCol_t scol; /* identifies which spare we're using */
|
||||
rf_MakeReconControl(RF_RaidReconDesc_t *reconDesc,
|
||||
RF_RowCol_t fcol, RF_RowCol_t scol)
|
||||
{
|
||||
RF_Raid_t *raidPtr = reconDesc->raidPtr;
|
||||
RF_RaidLayout_t *layoutPtr = &raidPtr->Layout;
|
||||
@ -149,8 +152,7 @@ rf_MakeReconControl(reconDesc, fcol, scol)
|
||||
}
|
||||
|
||||
void
|
||||
rf_FreeReconControl(raidPtr)
|
||||
RF_Raid_t *raidPtr;
|
||||
rf_FreeReconControl(RF_Raid_t *raidPtr)
|
||||
{
|
||||
RF_ReconCtrl_t *reconCtrlPtr = raidPtr->reconControl;
|
||||
RF_ReconBuffer_t *t;
|
||||
@ -178,8 +180,7 @@ rf_FreeReconControl(raidPtr)
|
||||
* computes the default head separation limit
|
||||
*****************************************************************************/
|
||||
RF_HeadSepLimit_t
|
||||
rf_GetDefaultHeadSepLimit(raidPtr)
|
||||
RF_Raid_t *raidPtr;
|
||||
rf_GetDefaultHeadSepLimit(RF_Raid_t *raidPtr)
|
||||
{
|
||||
RF_HeadSepLimit_t hsl;
|
||||
const RF_LayoutSW_t *lp;
|
||||
@ -196,8 +197,7 @@ rf_GetDefaultHeadSepLimit(raidPtr)
|
||||
* computes the default number of floating recon buffers
|
||||
*****************************************************************************/
|
||||
int
|
||||
rf_GetDefaultNumFloatingReconBuffers(raidPtr)
|
||||
RF_Raid_t *raidPtr;
|
||||
rf_GetDefaultNumFloatingReconBuffers(RF_Raid_t *raidPtr)
|
||||
{
|
||||
const RF_LayoutSW_t *lp;
|
||||
int nrb;
|
||||
@ -214,10 +214,7 @@ rf_GetDefaultNumFloatingReconBuffers(raidPtr)
|
||||
* creates and initializes a reconstruction buffer
|
||||
*****************************************************************************/
|
||||
RF_ReconBuffer_t *
|
||||
rf_MakeReconBuffer(
|
||||
RF_Raid_t * raidPtr,
|
||||
RF_RowCol_t col,
|
||||
RF_RbufType_t type)
|
||||
rf_MakeReconBuffer(RF_Raid_t *raidPtr, RF_RowCol_t col, RF_RbufType_t type)
|
||||
{
|
||||
RF_RaidLayout_t *layoutPtr = &raidPtr->Layout;
|
||||
RF_ReconBuffer_t *t;
|
||||
@ -237,8 +234,7 @@ rf_MakeReconBuffer(
|
||||
* frees a reconstruction buffer
|
||||
*****************************************************************************/
|
||||
void
|
||||
rf_FreeReconBuffer(rbuf)
|
||||
RF_ReconBuffer_t *rbuf;
|
||||
rf_FreeReconBuffer(RF_ReconBuffer_t *rbuf)
|
||||
{
|
||||
RF_Raid_t *raidPtr = rbuf->raidPtr;
|
||||
u_int recon_buffer_size;
|
||||
@ -254,9 +250,7 @@ rf_FreeReconBuffer(rbuf)
|
||||
* debug only: sanity check the number of floating recon bufs in use
|
||||
*****************************************************************************/
|
||||
void
|
||||
rf_CheckFloatingRbufCount(raidPtr, dolock)
|
||||
RF_Raid_t *raidPtr;
|
||||
int dolock;
|
||||
rf_CheckFloatingRbufCount(RF_Raid_t *raidPtr, int dolock)
|
||||
{
|
||||
RF_ReconParityStripeStatus_t *p;
|
||||
RF_PSStatusHeader_t *pssTable;
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: rf_revent.c,v 1.13 2003/12/29 03:33:48 oster Exp $ */
|
||||
/* $NetBSD: rf_revent.c,v 1.14 2003/12/30 21:59:03 oster Exp $ */
|
||||
/*
|
||||
* Copyright (c) 1995 Carnegie-Mellon University.
|
||||
* All rights reserved.
|
||||
@ -30,7 +30,7 @@
|
||||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: rf_revent.c,v 1.13 2003/12/29 03:33:48 oster Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: rf_revent.c,v 1.14 2003/12/30 21:59:03 oster Exp $");
|
||||
|
||||
#include <sys/errno.h>
|
||||
|
||||
@ -63,15 +63,13 @@ static void rf_ShutdownReconEvent(void *);
|
||||
static RF_ReconEvent_t *
|
||||
GetReconEventDesc(RF_RowCol_t col, void *arg, RF_Revent_t type);
|
||||
|
||||
static void rf_ShutdownReconEvent(ignored)
|
||||
void *ignored;
|
||||
static void rf_ShutdownReconEvent(void *ignored)
|
||||
{
|
||||
pool_destroy(&rf_revent_pool);
|
||||
}
|
||||
|
||||
int
|
||||
rf_ConfigureReconEvent(listp)
|
||||
RF_ShutdownList_t **listp;
|
||||
rf_ConfigureReconEvent(RF_ShutdownList_t **listp)
|
||||
{
|
||||
int rc;
|
||||
|
||||
@ -95,10 +93,8 @@ rf_ConfigureReconEvent(listp)
|
||||
* or will return an event if it is not */
|
||||
|
||||
RF_ReconEvent_t *
|
||||
rf_GetNextReconEvent(reconDesc, continueFunc, continueArg)
|
||||
RF_RaidReconDesc_t *reconDesc;
|
||||
void (*continueFunc) (void *);
|
||||
void *continueArg;
|
||||
rf_GetNextReconEvent(RF_RaidReconDesc_t *reconDesc,
|
||||
void (*continueFunc)(void *), void *continueArg)
|
||||
{
|
||||
RF_Raid_t *raidPtr = reconDesc->raidPtr;
|
||||
RF_ReconCtrl_t *rctrl = raidPtr->reconControl;
|
||||
@ -173,11 +169,8 @@ rf_GetNextReconEvent(reconDesc, continueFunc, continueArg)
|
||||
}
|
||||
/* enqueues a reconstruction event on the indicated queue */
|
||||
void
|
||||
rf_CauseReconEvent(raidPtr, col, arg, type)
|
||||
RF_Raid_t *raidPtr;
|
||||
RF_RowCol_t col;
|
||||
void *arg;
|
||||
RF_Revent_t type;
|
||||
rf_CauseReconEvent(RF_Raid_t *raidPtr, RF_RowCol_t col, void *arg,
|
||||
RF_Revent_t type)
|
||||
{
|
||||
RF_ReconCtrl_t *rctrl = raidPtr->reconControl;
|
||||
RF_ReconEvent_t *event = GetReconEventDesc(col, arg, type);
|
||||
@ -198,10 +191,7 @@ rf_CauseReconEvent(raidPtr, col, arg, type)
|
||||
}
|
||||
/* allocates and initializes a recon event descriptor */
|
||||
static RF_ReconEvent_t *
|
||||
GetReconEventDesc(col, arg, type)
|
||||
RF_RowCol_t col;
|
||||
void *arg;
|
||||
RF_Revent_t type;
|
||||
GetReconEventDesc(RF_RowCol_t col, void *arg, RF_Revent_t type)
|
||||
{
|
||||
RF_ReconEvent_t *t;
|
||||
|
||||
@ -216,8 +206,7 @@ GetReconEventDesc(col, arg, type)
|
||||
}
|
||||
|
||||
void
|
||||
rf_FreeReconEventDesc(event)
|
||||
RF_ReconEvent_t *event;
|
||||
rf_FreeReconEventDesc(RF_ReconEvent_t *event)
|
||||
{
|
||||
pool_put(&rf_revent_pool, event);
|
||||
}
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: rf_shutdown.c,v 1.14 2003/12/29 03:33:48 oster Exp $ */
|
||||
/* $NetBSD: rf_shutdown.c,v 1.15 2003/12/30 21:59:03 oster Exp $ */
|
||||
/*
|
||||
* rf_shutdown.c
|
||||
*/
|
||||
@ -34,7 +34,7 @@
|
||||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: rf_shutdown.c,v 1.14 2003/12/29 03:33:48 oster Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: rf_shutdown.c,v 1.15 2003/12/30 21:59:03 oster Exp $");
|
||||
|
||||
#include <dev/raidframe/raidframevar.h>
|
||||
|
||||
@ -50,18 +50,14 @@ __KERNEL_RCSID(0, "$NetBSD: rf_shutdown.c,v 1.14 2003/12/29 03:33:48 oster Exp $
|
||||
static void rf_FreeShutdownEnt(RF_ShutdownList_t *);
|
||||
|
||||
static void
|
||||
rf_FreeShutdownEnt(RF_ShutdownList_t * ent)
|
||||
rf_FreeShutdownEnt(RF_ShutdownList_t *ent)
|
||||
{
|
||||
FREE(ent, M_RAIDFRAME);
|
||||
}
|
||||
|
||||
int
|
||||
_rf_ShutdownCreate(
|
||||
RF_ShutdownList_t ** listp,
|
||||
void (*cleanup) (void *arg),
|
||||
void *arg,
|
||||
char *file,
|
||||
int line)
|
||||
_rf_ShutdownCreate(RF_ShutdownList_t **listp, void (*cleanup)(void *arg),
|
||||
void *arg, char *file, int line)
|
||||
{
|
||||
RF_ShutdownList_t *ent;
|
||||
|
||||
@ -85,7 +81,7 @@ _rf_ShutdownCreate(
|
||||
}
|
||||
|
||||
int
|
||||
rf_ShutdownList(RF_ShutdownList_t ** list)
|
||||
rf_ShutdownList(RF_ShutdownList_t **list)
|
||||
{
|
||||
RF_ShutdownList_t *r, *next;
|
||||
#if RF_DEBUG_SHUTDOWN
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: rf_states.c,v 1.21 2003/12/29 02:38:18 oster Exp $ */
|
||||
/* $NetBSD: rf_states.c,v 1.22 2003/12/30 21:59:03 oster Exp $ */
|
||||
/*
|
||||
* Copyright (c) 1995 Carnegie-Mellon University.
|
||||
* All rights reserved.
|
||||
@ -27,7 +27,7 @@
|
||||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: rf_states.c,v 1.21 2003/12/29 02:38:18 oster Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: rf_states.c,v 1.22 2003/12/30 21:59:03 oster Exp $");
|
||||
|
||||
#include <sys/errno.h>
|
||||
|
||||
@ -93,7 +93,7 @@ StateName(RF_AccessState_t state)
|
||||
#endif
|
||||
|
||||
void
|
||||
rf_ContinueRaidAccess(RF_RaidAccessDesc_t * desc)
|
||||
rf_ContinueRaidAccess(RF_RaidAccessDesc_t *desc)
|
||||
{
|
||||
int suspended = RF_FALSE;
|
||||
int current_state_index = desc->state;
|
||||
@ -160,7 +160,7 @@ rf_ContinueRaidAccess(RF_RaidAccessDesc_t * desc)
|
||||
|
||||
|
||||
void
|
||||
rf_ContinueDagAccess(RF_DagList_t * dagList)
|
||||
rf_ContinueDagAccess(RF_DagList_t *dagList)
|
||||
{
|
||||
RF_AccTraceEntry_t *tracerec = &(dagList->desc->tracerec);
|
||||
RF_RaidAccessDesc_t *desc;
|
||||
@ -202,7 +202,7 @@ rf_ContinueDagAccess(RF_DagList_t * dagList)
|
||||
}
|
||||
|
||||
int
|
||||
rf_State_LastState(RF_RaidAccessDesc_t * desc)
|
||||
rf_State_LastState(RF_RaidAccessDesc_t *desc)
|
||||
{
|
||||
void (*callbackFunc) (RF_CBParam_t) = desc->callbackFunc;
|
||||
RF_CBParam_t callbackArg;
|
||||
@ -243,7 +243,7 @@ rf_State_LastState(RF_RaidAccessDesc_t * desc)
|
||||
}
|
||||
|
||||
int
|
||||
rf_State_IncrAccessCount(RF_RaidAccessDesc_t * desc)
|
||||
rf_State_IncrAccessCount(RF_RaidAccessDesc_t *desc)
|
||||
{
|
||||
RF_Raid_t *raidPtr;
|
||||
|
||||
@ -259,7 +259,7 @@ rf_State_IncrAccessCount(RF_RaidAccessDesc_t * desc)
|
||||
}
|
||||
|
||||
int
|
||||
rf_State_DecrAccessCount(RF_RaidAccessDesc_t * desc)
|
||||
rf_State_DecrAccessCount(RF_RaidAccessDesc_t *desc)
|
||||
{
|
||||
RF_Raid_t *raidPtr;
|
||||
|
||||
@ -278,7 +278,7 @@ rf_State_DecrAccessCount(RF_RaidAccessDesc_t * desc)
|
||||
}
|
||||
|
||||
int
|
||||
rf_State_Quiesce(RF_RaidAccessDesc_t * desc)
|
||||
rf_State_Quiesce(RF_RaidAccessDesc_t *desc)
|
||||
{
|
||||
RF_AccTraceEntry_t *tracerec = &desc->tracerec;
|
||||
RF_Etimer_t timer;
|
||||
@ -318,7 +318,7 @@ rf_State_Quiesce(RF_RaidAccessDesc_t * desc)
|
||||
}
|
||||
|
||||
int
|
||||
rf_State_Map(RF_RaidAccessDesc_t * desc)
|
||||
rf_State_Map(RF_RaidAccessDesc_t *desc)
|
||||
{
|
||||
RF_Raid_t *raidPtr = desc->raidPtr;
|
||||
RF_AccTraceEntry_t *tracerec = &desc->tracerec;
|
||||
@ -339,7 +339,7 @@ rf_State_Map(RF_RaidAccessDesc_t * desc)
|
||||
}
|
||||
|
||||
int
|
||||
rf_State_Lock(RF_RaidAccessDesc_t * desc)
|
||||
rf_State_Lock(RF_RaidAccessDesc_t *desc)
|
||||
{
|
||||
RF_AccTraceEntry_t *tracerec = &desc->tracerec;
|
||||
RF_Raid_t *raidPtr = desc->raidPtr;
|
||||
@ -439,7 +439,7 @@ rf_State_Lock(RF_RaidAccessDesc_t * desc)
|
||||
* done (FAIL)
|
||||
*/
|
||||
int
|
||||
rf_State_CreateDAG(RF_RaidAccessDesc_t * desc)
|
||||
rf_State_CreateDAG(RF_RaidAccessDesc_t *desc)
|
||||
{
|
||||
RF_AccTraceEntry_t *tracerec = &desc->tracerec;
|
||||
RF_Etimer_t timer;
|
||||
@ -494,7 +494,7 @@ rf_State_CreateDAG(RF_RaidAccessDesc_t * desc)
|
||||
* dags for independents parity groups (stripes) are fired concurrently */
|
||||
|
||||
int
|
||||
rf_State_ExecuteDAG(RF_RaidAccessDesc_t * desc)
|
||||
rf_State_ExecuteDAG(RF_RaidAccessDesc_t *desc)
|
||||
{
|
||||
int i;
|
||||
RF_DagHeader_t *dag_h;
|
||||
@ -533,7 +533,7 @@ rf_State_ExecuteDAG(RF_RaidAccessDesc_t * desc)
|
||||
* if not, fire as many dags as possible */
|
||||
|
||||
int
|
||||
rf_State_ProcessDAG(RF_RaidAccessDesc_t * desc)
|
||||
rf_State_ProcessDAG(RF_RaidAccessDesc_t *desc)
|
||||
{
|
||||
RF_AccessStripeMapHeader_t *asmh = desc->asmap;
|
||||
RF_Raid_t *raidPtr = desc->raidPtr;
|
||||
@ -591,7 +591,7 @@ rf_State_ProcessDAG(RF_RaidAccessDesc_t * desc)
|
||||
}
|
||||
/* only make it this far if all dags complete successfully */
|
||||
int
|
||||
rf_State_Cleanup(RF_RaidAccessDesc_t * desc)
|
||||
rf_State_Cleanup(RF_RaidAccessDesc_t *desc)
|
||||
{
|
||||
RF_AccTraceEntry_t *tracerec = &desc->tracerec;
|
||||
RF_AccessStripeMapHeader_t *asmh = desc->asmap;
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: rf_stripelocks.c,v 1.20 2003/12/29 16:57:35 oster Exp $ */
|
||||
/* $NetBSD: rf_stripelocks.c,v 1.21 2003/12/30 21:59:03 oster Exp $ */
|
||||
/*
|
||||
* Copyright (c) 1995 Carnegie-Mellon University.
|
||||
* All rights reserved.
|
||||
@ -57,7 +57,7 @@
|
||||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: rf_stripelocks.c,v 1.20 2003/12/29 16:57:35 oster Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: rf_stripelocks.c,v 1.21 2003/12/30 21:59:03 oster Exp $");
|
||||
|
||||
#include <dev/raidframe/raidframevar.h>
|
||||
|
||||
@ -160,15 +160,13 @@ static void rf_ShutdownStripeLockFreeList(void *);
|
||||
static void rf_RaidShutdownStripeLocks(void *);
|
||||
|
||||
static void
|
||||
rf_ShutdownStripeLockFreeList(ignored)
|
||||
void *ignored;
|
||||
rf_ShutdownStripeLockFreeList(void *ignored)
|
||||
{
|
||||
pool_destroy(&rf_stripelock_pool);
|
||||
}
|
||||
|
||||
int
|
||||
rf_ConfigureStripeLockFreeList(listp)
|
||||
RF_ShutdownList_t **listp;
|
||||
rf_ConfigureStripeLockFreeList(RF_ShutdownList_t **listp)
|
||||
{
|
||||
unsigned mask;
|
||||
int rc;
|
||||
@ -225,18 +223,15 @@ rf_ShutdownStripeLocks(RF_LockTableEntry_t * lockTable)
|
||||
}
|
||||
|
||||
static void
|
||||
rf_RaidShutdownStripeLocks(arg)
|
||||
void *arg;
|
||||
rf_RaidShutdownStripeLocks(void *arg)
|
||||
{
|
||||
RF_Raid_t *raidPtr = (RF_Raid_t *) arg;
|
||||
rf_ShutdownStripeLocks(raidPtr->lockTable);
|
||||
}
|
||||
|
||||
int
|
||||
rf_ConfigureStripeLocks(
|
||||
RF_ShutdownList_t ** listp,
|
||||
RF_Raid_t * raidPtr,
|
||||
RF_Config_t * cfgPtr)
|
||||
rf_ConfigureStripeLocks(RF_ShutdownList_t **listp, RF_Raid_t *raidPtr,
|
||||
RF_Config_t *cfgPtr)
|
||||
{
|
||||
int rc;
|
||||
|
||||
@ -257,10 +252,8 @@ rf_ConfigureStripeLocks(
|
||||
* *releaseTag that you need to give back to us when you release the
|
||||
* lock. */
|
||||
int
|
||||
rf_AcquireStripeLock(
|
||||
RF_LockTableEntry_t * lockTable,
|
||||
RF_StripeNum_t stripeID,
|
||||
RF_LockReqDesc_t * lockReqDesc)
|
||||
rf_AcquireStripeLock(RF_LockTableEntry_t *lockTable, RF_StripeNum_t stripeID,
|
||||
RF_LockReqDesc_t *lockReqDesc)
|
||||
{
|
||||
RF_StripeLockDesc_t *lockDesc;
|
||||
RF_LockReqDesc_t *p;
|
||||
@ -378,10 +371,8 @@ rf_AcquireStripeLock(
|
||||
}
|
||||
|
||||
void
|
||||
rf_ReleaseStripeLock(
|
||||
RF_LockTableEntry_t * lockTable,
|
||||
RF_StripeNum_t stripeID,
|
||||
RF_LockReqDesc_t * lockReqDesc)
|
||||
rf_ReleaseStripeLock(RF_LockTableEntry_t *lockTable, RF_StripeNum_t stripeID,
|
||||
RF_LockReqDesc_t *lockReqDesc)
|
||||
{
|
||||
RF_StripeLockDesc_t *lockDesc, *ld_t;
|
||||
RF_LockReqDesc_t *lr, *lr_t, *callbacklist, *t;
|
||||
@ -638,9 +629,7 @@ rf_ReleaseStripeLock(
|
||||
}
|
||||
/* must have the indicated lock table mutex upon entry */
|
||||
static void
|
||||
AddToWaitersQueue(
|
||||
RF_StripeLockDesc_t * lockDesc,
|
||||
RF_LockReqDesc_t * lockReqDesc)
|
||||
AddToWaitersQueue(RF_StripeLockDesc_t *lockDesc, RF_LockReqDesc_t *lockReqDesc)
|
||||
{
|
||||
if (!lockDesc->waitersH) {
|
||||
lockDesc->waitersH = lockDesc->waitersT = lockReqDesc;
|
||||
@ -668,15 +657,14 @@ AllocStripeLockDesc(RF_StripeNum_t stripeID)
|
||||
}
|
||||
|
||||
static void
|
||||
FreeStripeLockDesc(RF_StripeLockDesc_t * p)
|
||||
FreeStripeLockDesc(RF_StripeLockDesc_t *p)
|
||||
{
|
||||
pool_put(&rf_stripelock_pool, p);
|
||||
}
|
||||
|
||||
#if RF_DEBUG_STRIPELOCK
|
||||
static void
|
||||
PrintLockedStripes(lockTable)
|
||||
RF_LockTableEntry_t *lockTable;
|
||||
PrintLockedStripes(RF_LockTableEntry_t *lockTable)
|
||||
{
|
||||
int i, j, foundone = 0, did;
|
||||
RF_StripeLockDesc_t *p;
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: rf_utils.c,v 1.11 2003/01/03 08:05:22 junyoung Exp $ */
|
||||
/* $NetBSD: rf_utils.c,v 1.12 2003/12/30 21:59:03 oster Exp $ */
|
||||
/*
|
||||
* Copyright (c) 1995 Carnegie-Mellon University.
|
||||
* All rights reserved.
|
||||
@ -33,7 +33,7 @@
|
||||
****************************************/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: rf_utils.c,v 1.11 2003/01/03 08:05:22 junyoung Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: rf_utils.c,v 1.12 2003/12/30 21:59:03 oster Exp $");
|
||||
|
||||
#include "rf_archs.h"
|
||||
#include "rf_utils.h"
|
||||
@ -42,10 +42,7 @@ __KERNEL_RCSID(0, "$NetBSD: rf_utils.c,v 1.11 2003/01/03 08:05:22 junyoung Exp $
|
||||
|
||||
/* creates & zeros 2-d array with b rows and k columns (MCH) */
|
||||
RF_RowCol_t **
|
||||
rf_make_2d_array(b, k, allocList)
|
||||
int b;
|
||||
int k;
|
||||
RF_AllocListElem_t *allocList;
|
||||
rf_make_2d_array(int b, int k, RF_AllocListElem_t *allocList)
|
||||
{
|
||||
RF_RowCol_t **retval, i;
|
||||
|
||||
@ -60,10 +57,7 @@ rf_make_2d_array(b, k, allocList)
|
||||
#if (RF_INCLUDE_PARITY_DECLUSTERING > 0) || (RF_INCLUDE_PARITY_DECLUSTERING_PQ > 0)
|
||||
|
||||
void
|
||||
rf_free_2d_array(a, b, k)
|
||||
RF_RowCol_t **a;
|
||||
int b;
|
||||
int k;
|
||||
rf_free_2d_array(RF_RowCol_t **a, int b, int k)
|
||||
{
|
||||
RF_RowCol_t i;
|
||||
|
||||
@ -75,9 +69,7 @@ rf_free_2d_array(a, b, k)
|
||||
|
||||
/* creates & zeros a 1-d array with c columns */
|
||||
RF_RowCol_t *
|
||||
rf_make_1d_array(c, allocList)
|
||||
int c;
|
||||
RF_AllocListElem_t *allocList;
|
||||
rf_make_1d_array(int c, RF_AllocListElem_t *allocList)
|
||||
{
|
||||
RF_RowCol_t *retval;
|
||||
|
||||
@ -87,9 +79,7 @@ rf_make_1d_array(c, allocList)
|
||||
}
|
||||
|
||||
void
|
||||
rf_free_1d_array(a, n)
|
||||
RF_RowCol_t *a;
|
||||
int n;
|
||||
rf_free_1d_array(RF_RowCol_t *a, int n)
|
||||
{
|
||||
RF_Free(a, n * sizeof(RF_RowCol_t));
|
||||
}
|
||||
@ -98,9 +88,7 @@ rf_free_1d_array(a, n)
|
||||
* between a and b. (MCH)
|
||||
*/
|
||||
int
|
||||
rf_gcd(m, n)
|
||||
int m;
|
||||
int n;
|
||||
rf_gcd(int m, int n)
|
||||
{
|
||||
int t;
|
||||
|
||||
@ -123,8 +111,7 @@ rf_gcd(m, n)
|
||||
( ((x) >= 'A' && (x) <= 'F') ? (x) - 'A' + 10 : (x - '0') ) )
|
||||
|
||||
int
|
||||
rf_atoi(p)
|
||||
char *p;
|
||||
rf_atoi(char *p)
|
||||
{
|
||||
int val = 0, negate = 0;
|
||||
|
||||
@ -138,8 +125,7 @@ rf_atoi(p)
|
||||
}
|
||||
|
||||
int
|
||||
rf_htoi(p)
|
||||
char *p;
|
||||
rf_htoi(char *p)
|
||||
{
|
||||
int val = 0;
|
||||
for (; ISHEXCHAR(*p); p++)
|
||||
|
Loading…
x
Reference in New Issue
Block a user