fix the function pointer and callback mess:

- callback functions return 0 and their result is not checked; make them void.
- there are two types of callbacks and they used to overload their parameters
  and the callback structure; separate them into "function" and "value"
  callbacks.
- make the wait function signature consistent.
This commit is contained in:
christos 2019-10-10 03:43:59 +00:00
parent 5dc161e026
commit b67baf4ca0
46 changed files with 363 additions and 382 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: raidframevar.h,v 1.20 2019/09/26 01:36:10 christos Exp $ */
/* $NetBSD: raidframevar.h,v 1.21 2019/10/10 03:43:59 christos Exp $ */
/*-
* Copyright (c) 1996, 1997, 1998 The NetBSD Foundation, Inc.
* All rights reserved.
@ -210,7 +210,8 @@ typedef RF_uint32 RF_RaidAccessFlags_t;
typedef struct RF_AccessStripeMap_s RF_AccessStripeMap_t;
typedef struct RF_AccessStripeMapHeader_s RF_AccessStripeMapHeader_t;
typedef struct RF_AllocListElem_s RF_AllocListElem_t;
typedef struct RF_CallbackDesc_s RF_CallbackDesc_t;
typedef struct RF_CallbackFuncDesc_s RF_CallbackFuncDesc_t;
typedef struct RF_CallbackValueDesc_s RF_CallbackValueDesc_t;
typedef struct RF_ChunkDesc_s RF_ChunkDesc_t;
typedef struct RF_CommonLogData_s RF_CommonLogData_t;
typedef struct RF_Config_s RF_Config_t;

View File

@ -1,4 +1,4 @@
/* $NetBSD: rf_callback.c,v 1.23 2019/02/10 17:13:33 christos Exp $ */
/* $NetBSD: rf_callback.c,v 1.24 2019/10/10 03:43:59 christos Exp $ */
/*
* Copyright (c) 1995 Carnegie-Mellon University.
* All rights reserved.
@ -34,7 +34,7 @@
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: rf_callback.c,v 1.23 2019/02/10 17:13:33 christos Exp $");
__KERNEL_RCSID(0, "$NetBSD: rf_callback.c,v 1.24 2019/10/10 03:43:59 christos Exp $");
#include <dev/raidframe/raidframevar.h>
#include <sys/pool.h>
@ -54,28 +54,43 @@ static void rf_ShutdownCallback(void *);
static void
rf_ShutdownCallback(void *ignored)
{
pool_destroy(&rf_pools.callback);
pool_destroy(&rf_pools.callbackf);
pool_destroy(&rf_pools.callbackv);
}
int
rf_ConfigureCallback(RF_ShutdownList_t **listp)
{
rf_pool_init(&rf_pools.callback, sizeof(RF_CallbackDesc_t),
"rf_callbackpl", RF_MIN_FREE_CALLBACK, RF_MAX_FREE_CALLBACK);
rf_pool_init(&rf_pools.callbackf, sizeof(RF_CallbackFuncDesc_t),
"rf_callbackfpl", RF_MIN_FREE_CALLBACK, RF_MAX_FREE_CALLBACK);
rf_pool_init(&rf_pools.callbackv, sizeof(RF_CallbackValueDesc_t),
"rf_callbackvpl", RF_MIN_FREE_CALLBACK, RF_MAX_FREE_CALLBACK);
rf_ShutdownCreate(listp, rf_ShutdownCallback, NULL);
return (0);
}
RF_CallbackDesc_t *
rf_AllocCallbackDesc(void)
RF_CallbackFuncDesc_t *
rf_AllocCallbackFuncDesc(void)
{
return pool_get(&rf_pools.callback, PR_WAITOK);
return pool_get(&rf_pools.callbackf, PR_WAITOK);
}
void
rf_FreeCallbackDesc(RF_CallbackDesc_t *p)
rf_FreeCallbackFuncDesc(RF_CallbackFuncDesc_t *p)
{
pool_put(&rf_pools.callback, p);
pool_put(&rf_pools.callbackf, p);
}
RF_CallbackValueDesc_t *
rf_AllocCallbackValueDesc(void)
{
return pool_get(&rf_pools.callbackv, PR_WAITOK);
}
void
rf_FreeCallbackValueDesc(RF_CallbackValueDesc_t *p)
{
pool_put(&rf_pools.callbackv, p);
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: rf_callback.h,v 1.6 2005/12/11 12:23:37 christos Exp $ */
/* $NetBSD: rf_callback.h,v 1.7 2019/10/10 03:43:59 christos Exp $ */
/*
* Copyright (c) 1995 Carnegie-Mellon University.
* All rights reserved.
@ -46,16 +46,23 @@
#include <dev/raidframe/raidframevar.h>
struct RF_CallbackDesc_s {
void (*callbackFunc) (RF_CBParam_t); /* function to call */
RF_CBParam_t callbackArg; /* args to give to function, or just
* info about this callback */
struct RF_CallbackFuncDesc_s {
void (*callbackFunc) (void *); /* function to call */
void *callbackArg; /* args to give to function, or just
* info about this callback */
RF_CallbackFuncDesc_t *next;/* next entry in list */
};
struct RF_CallbackValueDesc_s {
RF_uint64 v;
RF_RowCol_t col; /* column IDs to give to the callback func */
RF_CallbackDesc_t *next;/* next entry in list */
RF_CallbackValueDesc_t *next;/* next entry in list */
};
int rf_ConfigureCallback(RF_ShutdownList_t ** listp);
RF_CallbackDesc_t *rf_AllocCallbackDesc(void);
void rf_FreeCallbackDesc(RF_CallbackDesc_t * p);
RF_CallbackFuncDesc_t *rf_AllocCallbackFuncDesc(void);
void rf_FreeCallbackFuncDesc(RF_CallbackFuncDesc_t * p);
RF_CallbackValueDesc_t *rf_AllocCallbackValueDesc(void);
void rf_FreeCallbackValueDesc(RF_CallbackValueDesc_t * p);
#endif /* !_RF__RF_CALLBACK_H_ */

View File

@ -1,4 +1,4 @@
/* $NetBSD: rf_copyback.c,v 1.51 2019/02/09 03:33:59 christos Exp $ */
/* $NetBSD: rf_copyback.c,v 1.52 2019/10/10 03:43:59 christos Exp $ */
/*
* Copyright (c) 1995 Carnegie-Mellon University.
* All rights reserved.
@ -38,7 +38,7 @@
****************************************************************************/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: rf_copyback.c,v 1.51 2019/02/09 03:33:59 christos Exp $");
__KERNEL_RCSID(0, "$NetBSD: rf_copyback.c,v 1.52 2019/10/10 03:43:59 christos Exp $");
#include <dev/raidframe/raidframevar.h>
@ -61,8 +61,8 @@ __KERNEL_RCSID(0, "$NetBSD: rf_copyback.c,v 1.51 2019/02/09 03:33:59 christos Ex
int rf_copyback_in_progress;
static int rf_CopybackReadDoneProc(RF_CopybackDesc_t * desc, int status);
static int rf_CopybackWriteDoneProc(RF_CopybackDesc_t * desc, int status);
static void rf_CopybackReadDoneProc(void *, int);
static void rf_CopybackWriteDoneProc(void *, int);
static void rf_CopybackOne(RF_CopybackDesc_t * desc, int typ,
RF_RaidAddr_t addr, RF_RowCol_t testCol,
RF_SectorNum_t testOffs);
@ -334,13 +334,11 @@ rf_CopybackOne(RF_CopybackDesc_t *desc, int typ, RF_RaidAddr_t addr,
/* create reqs to read the old location & write the new */
desc->readreq = rf_CreateDiskQueueData(RF_IO_TYPE_READ, spOffs,
sectPerSU, desc->databuf, 0L, 0,
(int (*) (void *, int)) rf_CopybackReadDoneProc, desc,
sectPerSU, desc->databuf, 0L, 0, rf_CopybackReadDoneProc, desc,
NULL, (void *) raidPtr, RF_DISKQUEUE_DATA_FLAGS_NONE, NULL,
PR_WAITOK);
desc->writereq = rf_CreateDiskQueueData(RF_IO_TYPE_WRITE, testOffs,
sectPerSU, desc->databuf, 0L, 0,
(int (*) (void *, int)) rf_CopybackWriteDoneProc, desc,
sectPerSU, desc->databuf, 0L, 0, rf_CopybackWriteDoneProc, desc,
NULL, (void *) raidPtr, RF_DISKQUEUE_DATA_FLAGS_NONE, NULL,
PR_WAITOK);
desc->fcol = testCol;
@ -368,9 +366,10 @@ rf_CopybackOne(RF_CopybackDesc_t *desc, int typ, RF_RaidAddr_t addr,
/* called at interrupt context when the read has completed. just send out the write */
static int
rf_CopybackReadDoneProc(RF_CopybackDesc_t *desc, int status)
static void
rf_CopybackReadDoneProc(void *v, int status)
{
RF_CopybackDesc_t *desc = v;
if (status) { /* invoke the callback with bad status */
printf("raid%d: copyback read failed. Aborting.\n",
desc->raidPtr->raidid);
@ -378,23 +377,22 @@ rf_CopybackReadDoneProc(RF_CopybackDesc_t *desc, int status)
} else {
rf_DiskIOEnqueue(&(desc->raidPtr->Queues[desc->fcol]), desc->writereq, RF_IO_NORMAL_PRIORITY);
}
return (0);
}
/* called at interrupt context when the write has completed.
* at user level & in the kernel, wake up the copyback thread.
* in the simulator, invoke the next copyback directly.
* can't free diskqueuedata structs in the kernel b/c we're at interrupt context.
*/
static int
rf_CopybackWriteDoneProc(RF_CopybackDesc_t *desc, int status)
static void
rf_CopybackWriteDoneProc(void *v, int status)
{
RF_CopybackDesc_t *desc = v;
if (status && status != -100) {
printf("raid%d: copyback write failed. Aborting.\n",
desc->raidPtr->raidid);
}
desc->status = status;
rf_MCPairWakeupFunc(desc->mcpair);
return (0);
}
/* invoked when the copyback has completed */
static void

View File

@ -1,4 +1,4 @@
/* $NetBSD: rf_dag.h,v 1.19 2005/12/11 12:23:37 christos Exp $ */
/* $NetBSD: rf_dag.h,v 1.20 2019/10/10 03:43:59 christos Exp $ */
/*
* Copyright (c) 1995 Carnegie-Mellon University.
* All rights reserved.
@ -89,11 +89,11 @@ typedef RF_uint8 RF_DagNodeFlags_t;
struct RF_DagNode_s {
RF_NodeStatus_t status; /* current status of this node */
int (*doFunc) (RF_DagNode_t *); /* normal function */
int (*undoFunc) (RF_DagNode_t *); /* func to remove effect of
void (*doFunc) (RF_DagNode_t *); /* normal function */
void (*undoFunc) (RF_DagNode_t *); /* func to remove effect of
* doFunc */
int (*wakeFunc) (RF_DagNode_t *, int status); /* func called when the
* node completes an I/O */
void (*wakeFunc) (void *, int); /* func called when the
* node completes an I/O */
int numParams; /* number of parameters required by *funcPtr */
int numResults; /* number of results produced by *funcPtr */
int numAntecedents; /* number of antecedents */

View File

@ -1,4 +1,4 @@
/* $NetBSD: rf_dagdegrd.c,v 1.30 2019/02/09 03:34:00 christos Exp $ */
/* $NetBSD: rf_dagdegrd.c,v 1.31 2019/10/10 03:43:59 christos 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.30 2019/02/09 03:34:00 christos Exp $");
__KERNEL_RCSID(0, "$NetBSD: rf_dagdegrd.c,v 1.31 2019/10/10 03:43:59 christos Exp $");
#include <dev/raidframe/raidframevar.h>
@ -1040,7 +1040,7 @@ rf_DoubleDegRead(RF_Raid_t *raidPtr, RF_AccessStripeMap_t *asmap,
RF_AllocListElem_t *allocList,
const char *redundantReadNodeName,
const char *recoveryNodeName,
int (*recovFunc) (RF_DagNode_t *))
void (*recovFunc) (RF_DagNode_t *))
{
RF_RaidLayout_t *layoutPtr = &(raidPtr->Layout);
RF_DagNode_t *nodes, *rudNodes, *rrdNodes, *recoveryNode, *blockNode,

View File

@ -1,4 +1,4 @@
/* $NetBSD: rf_dagdegrd.h,v 1.8 2006/04/26 17:08:48 oster Exp $ */
/* $NetBSD: rf_dagdegrd.h,v 1.9 2019/10/10 03:43:59 christos Exp $ */
/*
* Copyright (c) 1995 Carnegie-Mellon University.
* All rights reserved.
@ -58,6 +58,6 @@ 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, const char *redundantReadNodeName,
const char *recoveryNodeName, int (*recovFunc) (RF_DagNode_t *));
const char *recoveryNodeName, void (*recovFunc) (RF_DagNode_t *));
#endif /* !_RF__RF_DAGDEGRD_H_ */

View File

@ -1,4 +1,4 @@
/* $NetBSD: rf_dagdegwr.c,v 1.34 2019/02/09 03:34:00 christos Exp $ */
/* $NetBSD: rf_dagdegwr.c,v 1.35 2019/10/10 03:43:59 christos 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.34 2019/02/09 03:34:00 christos Exp $");
__KERNEL_RCSID(0, "$NetBSD: rf_dagdegwr.c,v 1.35 2019/10/10 03:43:59 christos Exp $");
#include <dev/raidframe/raidframevar.h>
@ -160,7 +160,7 @@ rf_CommonCreateSimpleDegradedWriteDAG(RF_Raid_t *raidPtr,
RF_RaidAccessFlags_t flags,
RF_AllocListElem_t *allocList,
int nfaults,
int (*redFunc) (RF_DagNode_t *),
void (*redFunc) (RF_DagNode_t *),
int allowBufferRecycle)
{
int nRrdNodes, nWndNodes, nXorBufs, i, j, paramNum,
@ -716,7 +716,7 @@ rf_DoubleDegSmallWrite(RF_Raid_t *raidPtr, RF_AccessStripeMap_t *asmap,
const char *redundantReadNodeName,
const char *redundantWriteNodeName,
const char *recoveryNodeName,
int (*recovFunc) (RF_DagNode_t *))
void (*recovFunc) (RF_DagNode_t *))
{
RF_RaidLayout_t *layoutPtr = &(raidPtr->Layout);
RF_DagNode_t *nodes, *wudNodes, *rrdNodes, *recoveryNode, *blockNode,

View File

@ -1,4 +1,4 @@
/* $NetBSD: rf_dagdegwr.h,v 1.6 2006/05/14 21:45:00 elad Exp $ */
/* $NetBSD: rf_dagdegwr.h,v 1.7 2019/10/10 03:43:59 christos Exp $ */
/*
* Copyright (c) 1995 Carnegie-Mellon University.
* All rights reserved.
@ -38,7 +38,7 @@ void rf_CreateDegradedWriteDAG(RF_Raid_t * raidPtr,
void 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 nfaults, void (*redFunc) (RF_DagNode_t *), int allowBufferRecycle);
void rf_WriteGenerateFailedAccessASMs(RF_Raid_t * raidPtr,
RF_AccessStripeMap_t * asmap, RF_PhysDiskAddr_t ** pdap,
@ -49,6 +49,6 @@ 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, const char *redundantReadNodeName,
const char *redundantWriteNodeName, const char *recoveryNodeName,
int (*recovFunc) (RF_DagNode_t *));
void (*recovFunc) (RF_DagNode_t *));
#endif /* !_RF__RF_DAGDEGWR_H_ */

View File

@ -1,4 +1,4 @@
/* $NetBSD: rf_dagffrd.c,v 1.20 2016/12/11 05:27:00 nat Exp $ */
/* $NetBSD: rf_dagffrd.c,v 1.21 2019/10/10 03:43:59 christos 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.20 2016/12/11 05:27:00 nat Exp $");
__KERNEL_RCSID(0, "$NetBSD: rf_dagffrd.c,v 1.21 2019/10/10 03:43:59 christos Exp $");
#include <dev/raidframe/raidframevar.h>
@ -132,7 +132,7 @@ rf_CreateNonredundantDAG(RF_Raid_t *raidPtr,
RF_DagNode_t *diskNodes, *blockNode, *commitNode, *termNode;
RF_DagNode_t *tmpNode, *tmpdiskNode;
RF_PhysDiskAddr_t *pda = asmap->physInfo;
int (*doFunc) (RF_DagNode_t *), (*undoFunc) (RF_DagNode_t *);
void (*doFunc) (RF_DagNode_t *), (*undoFunc) (RF_DagNode_t *);
int i, n;
const char *name;
@ -323,7 +323,7 @@ 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))
void (*readfunc) (RF_DagNode_t * node))
{
RF_DagNode_t *readNodes, *blockNode, *commitNode, *termNode;
RF_DagNode_t *tmpNode, *tmpreadNode;

View File

@ -1,4 +1,4 @@
/* $NetBSD: rf_dagffwr.c,v 1.35 2019/02/09 03:34:00 christos Exp $ */
/* $NetBSD: rf_dagffwr.c,v 1.36 2019/10/10 03:43:59 christos 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.35 2019/02/09 03:34:00 christos Exp $");
__KERNEL_RCSID(0, "$NetBSD: rf_dagffwr.c,v 1.36 2019/10/10 03:43:59 christos Exp $");
#include <dev/raidframe/raidframevar.h>
@ -165,7 +165,7 @@ 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 nfaults, void (*redFunc) (RF_DagNode_t *),
int allowBufferRecycle)
{
RF_DagNode_t *wndNodes, *rodNodes, *xorNode, *wnpNode, *tmpNode;
@ -538,8 +538,8 @@ rf_CommonCreateSmallWriteDAG(RF_Raid_t *raidPtr, RF_AccessStripeMap_t *asmap,
#endif
int i, j, nNodes;
RF_ReconUnitNum_t which_ru;
int (*func) (RF_DagNode_t *), (*undoFunc) (RF_DagNode_t *);
int (*qfunc) (RF_DagNode_t *) __unused;
void (*func) (RF_DagNode_t *), (*undoFunc) (RF_DagNode_t *);
void (*qfunc) (RF_DagNode_t *) __unused;
int numDataNodes, numParityNodes;
RF_StripeNum_t parityStripeID;
RF_PhysDiskAddr_t *pda;

View File

@ -1,4 +1,4 @@
/* $NetBSD: rf_dagffwr.h,v 1.7 2005/12/11 12:23:37 christos Exp $ */
/* $NetBSD: rf_dagffwr.h,v 1.8 2019/10/10 03:43:59 christos Exp $ */
/*
* Copyright (c) 1995 Carnegie-Mellon University.
* All rights reserved.
@ -53,24 +53,24 @@ 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);
void rf_CommonCreateLargeWriteDAGFwd(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);
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,
void (*redFunc) (RF_DagNode_t *), int allowBufferRecycle);
void rf_CommonCreateLargeWriteDAGFwd(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,
void (*redFunc) (RF_DagNode_t *), int allowBufferRecycle);
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);
void rf_CommonCreateSmallWriteDAGFwd(RF_Raid_t * raidPtr,
RF_AccessStripeMap_t * asmap, RF_DagHeader_t * dag_h, void *bp,
RF_RaidAccessFlags_t flags, RF_AllocListElem_t * allocList,
const RF_RedFuncs_t * pfuncs, const RF_RedFuncs_t * qfuncs);
void rf_CommonCreateSmallWriteDAGFwd(RF_Raid_t * raidPtr,
RF_AccessStripeMap_t * asmap, RF_DagHeader_t * dag_h, void *bp,
RF_RaidAccessFlags_t flags, RF_AllocListElem_t * allocList,
const RF_RedFuncs_t * pfuncs, const RF_RedFuncs_t * qfuncs);
void rf_CreateRaidOneWriteDAG(RF_Raid_t * raidPtr, RF_AccessStripeMap_t * asmap,
RF_DagHeader_t * dag_h, void *bp, RF_RaidAccessFlags_t flags,
RF_AllocListElem_t * allocList);
void rf_CreateRaidOneWriteDAGFwd(RF_Raid_t * raidPtr,
RF_AccessStripeMap_t * asmap, RF_DagHeader_t * dag_h, void *bp,
RF_RaidAccessFlags_t flags, RF_AllocListElem_t * allocList);
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);
void rf_CreateRaidOneWriteDAGFwd(RF_Raid_t * raidPtr,
RF_AccessStripeMap_t * asmap, RF_DagHeader_t * dag_h, void *bp,
RF_RaidAccessFlags_t flags, RF_AllocListElem_t * allocList);
#endif /* !_RF__RF_DAGFFWR_H_ */

View File

@ -1,4 +1,4 @@
/* $NetBSD: rf_dagfuncs.c,v 1.30 2009/03/23 18:38:54 oster Exp $ */
/* $NetBSD: rf_dagfuncs.c,v 1.31 2019/10/10 03:43:59 christos 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.30 2009/03/23 18:38:54 oster Exp $");
__KERNEL_RCSID(0, "$NetBSD: rf_dagfuncs.c,v 1.31 2019/10/10 03:43:59 christos Exp $");
#include <sys/param.h>
#include <sys/ioctl.h>
@ -71,13 +71,13 @@ __KERNEL_RCSID(0, "$NetBSD: rf_dagfuncs.c,v 1.30 2009/03/23 18:38:54 oster Exp $
#include "rf_paritylog.h"
#endif /* RF_INCLUDE_PARITYLOGGING > 0 */
int (*rf_DiskReadFunc) (RF_DagNode_t *);
int (*rf_DiskWriteFunc) (RF_DagNode_t *);
int (*rf_DiskReadUndoFunc) (RF_DagNode_t *);
int (*rf_DiskWriteUndoFunc) (RF_DagNode_t *);
int (*rf_RegularXorUndoFunc) (RF_DagNode_t *);
int (*rf_SimpleXorUndoFunc) (RF_DagNode_t *);
int (*rf_RecoveryXorUndoFunc) (RF_DagNode_t *);
void (*rf_DiskReadFunc) (RF_DagNode_t *);
void (*rf_DiskWriteFunc) (RF_DagNode_t *);
void (*rf_DiskReadUndoFunc) (RF_DagNode_t *);
void (*rf_DiskWriteUndoFunc) (RF_DagNode_t *);
void (*rf_RegularXorUndoFunc) (RF_DagNode_t *);
void (*rf_SimpleXorUndoFunc) (RF_DagNode_t *);
void (*rf_RecoveryXorUndoFunc) (RF_DagNode_t *);
/*****************************************************************************
* main (only) configuration routine for this module
@ -102,18 +102,17 @@ rf_ConfigureDAGFuncs(RF_ShutdownList_t **listp)
/*****************************************************************************
* the execution function associated with a terminate node
****************************************************************************/
int
void
rf_TerminateFunc(RF_DagNode_t *node)
{
RF_ASSERT(node->dagHdr->numCommits == node->dagHdr->numCommitNodes);
node->status = rf_good;
return (rf_FinishNode(node, RF_THREAD_CONTEXT));
rf_FinishNode(node, RF_THREAD_CONTEXT);
}
int
void
rf_TerminateUndoFunc(RF_DagNode_t *node)
{
return (0);
}
@ -130,32 +129,31 @@ rf_TerminateUndoFunc(RF_DagNode_t *node)
*
****************************************************************************/
int
void
rf_DiskReadMirrorIdleFunc(RF_DagNode_t *node)
{
/* select the mirror copy with the shortest queue and fill in node
* parameters with physical disk address */
rf_SelectMirrorDiskIdle(node);
return (rf_DiskReadFunc(node));
rf_DiskReadFunc(node);
}
#if (RF_INCLUDE_CHAINDECLUSTER > 0) || (RF_INCLUDE_INTERDECLUSTER > 0) || (RF_DEBUG_VALIDATE_DAG > 0)
int
void
rf_DiskReadMirrorPartitionFunc(RF_DagNode_t *node)
{
/* select the mirror copy with the shortest queue and fill in node
* parameters with physical disk address */
rf_SelectMirrorDiskPartition(node);
return (rf_DiskReadFunc(node));
rf_DiskReadFunc(node);
}
#endif
int
void
rf_DiskReadMirrorUndoFunc(RF_DagNode_t *node)
{
return (0);
}
@ -164,7 +162,7 @@ rf_DiskReadMirrorUndoFunc(RF_DagNode_t *node)
/*****************************************************************************
* the execution function associated with a parity log update node
****************************************************************************/
int
void
rf_ParityLogUpdateFunc(RF_DagNode_t *node)
{
RF_PhysDiskAddr_t *pda = (RF_PhysDiskAddr_t *) node->params[0].p;
@ -181,7 +179,7 @@ rf_ParityLogUpdateFunc(RF_DagNode_t *node)
#endif
logData = rf_CreateParityLogData(RF_UPDATE, pda, bf,
(RF_Raid_t *) (node->dagHdr->raidPtr),
node->wakeFunc, (void *) node,
node->wakeFunc, node,
node->dagHdr->tracerec, timer);
if (logData)
rf_ParityLogAppend(logData, RF_FALSE, NULL, RF_FALSE);
@ -194,14 +192,13 @@ rf_ParityLogUpdateFunc(RF_DagNode_t *node)
(node->wakeFunc) (node, ENOMEM);
}
}
return (0);
}
/*****************************************************************************
* the execution function associated with a parity log overwrite node
****************************************************************************/
int
void
rf_ParityLogOverwriteFunc(RF_DagNode_t *node)
{
RF_PhysDiskAddr_t *pda = (RF_PhysDiskAddr_t *) node->params[0].p;
@ -218,7 +215,7 @@ rf_ParityLogOverwriteFunc(RF_DagNode_t *node)
#endif
logData = rf_CreateParityLogData(RF_OVERWRITE, pda, bf,
(RF_Raid_t *) (node->dagHdr->raidPtr),
node->wakeFunc, (void *) node, node->dagHdr->tracerec, timer);
node->wakeFunc, node, node->dagHdr->tracerec, timer);
if (logData)
rf_ParityLogAppend(logData, RF_FALSE, NULL, RF_FALSE);
else {
@ -230,44 +227,41 @@ rf_ParityLogOverwriteFunc(RF_DagNode_t *node)
(node->wakeFunc) (node, ENOMEM);
}
}
return (0);
}
int
void
rf_ParityLogUpdateUndoFunc(RF_DagNode_t *node)
{
return (0);
}
int
void
rf_ParityLogOverwriteUndoFunc(RF_DagNode_t *node)
{
return (0);
}
#endif /* RF_INCLUDE_PARITYLOGGING > 0 */
/*****************************************************************************
* the execution function associated with a NOP node
****************************************************************************/
int
void
rf_NullNodeFunc(RF_DagNode_t *node)
{
node->status = rf_good;
return (rf_FinishNode(node, RF_THREAD_CONTEXT));
rf_FinishNode(node, RF_THREAD_CONTEXT);
}
int
void
rf_NullNodeUndoFunc(RF_DagNode_t *node)
{
node->status = rf_undone;
return (rf_FinishNode(node, RF_THREAD_CONTEXT));
rf_FinishNode(node, RF_THREAD_CONTEXT);
}
/*****************************************************************************
* the execution function associated with a disk-read node
****************************************************************************/
int
void
rf_DiskReadFuncForThreads(RF_DagNode_t *node)
{
RF_DiskQueueData_t *req;
@ -284,9 +278,7 @@ rf_DiskReadFuncForThreads(RF_DagNode_t *node)
b_proc = (void *) ((struct buf *) node->dagHdr->bp)->b_proc;
req = rf_CreateDiskQueueData(iotype, pda->startSector, pda->numSector,
bf, parityStripeID, which_ru,
(int (*) (void *, int)) node->wakeFunc,
node,
bf, parityStripeID, which_ru, node->wakeFunc, node,
#if RF_ACC_TRACE > 0
node->dagHdr->tracerec,
#else
@ -299,14 +291,13 @@ rf_DiskReadFuncForThreads(RF_DagNode_t *node)
node->dagFuncData = (void *) req;
rf_DiskIOEnqueue(&(dqs[pda->col]), req, priority);
}
return (0);
}
/*****************************************************************************
* the execution function associated with a disk-write node
****************************************************************************/
int
void
rf_DiskWriteFuncForThreads(RF_DagNode_t *node)
{
RF_DiskQueueData_t *req;
@ -324,9 +315,7 @@ rf_DiskWriteFuncForThreads(RF_DagNode_t *node)
/* normal processing (rollaway or forward recovery) begins here */
req = rf_CreateDiskQueueData(iotype, pda->startSector, pda->numSector,
bf, parityStripeID, which_ru,
(int (*) (void *, int)) node->wakeFunc,
(void *) node,
bf, parityStripeID, which_ru, node->wakeFunc, node,
#if RF_ACC_TRACE > 0
node->dagHdr->tracerec,
#else
@ -341,15 +330,13 @@ rf_DiskWriteFuncForThreads(RF_DagNode_t *node)
node->dagFuncData = (void *) req;
rf_DiskIOEnqueue(&(dqs[pda->col]), req, priority);
}
return (0);
}
/*****************************************************************************
* the undo function for disk nodes
* Note: this is not a proper undo of a write node, only locks are released.
* old data is not restored to disk!
****************************************************************************/
int
void
rf_DiskUndoFunc(RF_DagNode_t *node)
{
RF_DiskQueueData_t *req;
@ -357,9 +344,7 @@ rf_DiskUndoFunc(RF_DagNode_t *node)
RF_DiskQueue_t *dqs = ((RF_Raid_t *) (node->dagHdr->raidPtr))->Queues;
req = rf_CreateDiskQueueData(RF_IO_TYPE_NOP,
0L, 0, NULL, 0L, 0,
(int (*) (void *, int)) node->wakeFunc,
(void *) node,
0L, 0, NULL, 0L, 0, node->wakeFunc, node,
#if RF_ACC_TRACE > 0
node->dagHdr->tracerec,
#else
@ -373,8 +358,6 @@ rf_DiskUndoFunc(RF_DagNode_t *node)
node->dagFuncData = (void *) req;
rf_DiskIOEnqueue(&(dqs[pda->col]), req, RF_IO_NORMAL_PRIORITY);
}
return (0);
}
/*****************************************************************************
@ -382,9 +365,10 @@ rf_DiskUndoFunc(RF_DagNode_t *node)
* op completes, the routine is called to set the node status and
* inform the execution engine that the node has fired.
****************************************************************************/
int
rf_GenericWakeupFunc(RF_DagNode_t *node, int status)
void
rf_GenericWakeupFunc(void *v, int status)
{
RF_DagNode_t *node = v;
switch (node->status) {
case rf_fired:
@ -409,7 +393,7 @@ rf_GenericWakeupFunc(RF_DagNode_t *node, int status)
}
if (node->dagFuncData)
rf_FreeDiskQueueData((RF_DiskQueueData_t *) node->dagFuncData);
return (rf_FinishNode(node, RF_INTR_CONTEXT));
rf_FinishNode(node, RF_INTR_CONTEXT);
}
@ -438,7 +422,7 @@ rf_GenericWakeupFunc(RF_DagNode_t *node, int status)
* assume the result field points to a buffer that is the size of one
* SU, and use the pda params to determine where within the buffer to
* XOR the input buffers. */
int
void
rf_RegularXorFunc(RF_DagNode_t *node)
{
RF_Raid_t *raidPtr = (RF_Raid_t *) node->params[node->numParams - 1].p;
@ -465,12 +449,12 @@ rf_RegularXorFunc(RF_DagNode_t *node)
tracerec->xor_us += RF_ETIMER_VAL_US(timer);
#endif
}
return (rf_GenericWakeupFunc(node, retcode)); /* call wake func
* explicitly since no
* I/O in this node */
rf_GenericWakeupFunc(node, retcode); /* call wake func
* explicitly since no
* I/O in this node */
}
/* xor the inputs into the result buffer, ignoring placement issues */
int
void
rf_SimpleXorFunc(RF_DagNode_t *node)
{
RF_Raid_t *raidPtr = (RF_Raid_t *) node->params[node->numParams - 1].p;
@ -496,9 +480,9 @@ rf_SimpleXorFunc(RF_DagNode_t *node)
tracerec->xor_us += RF_ETIMER_VAL_US(timer);
#endif
}
return (rf_GenericWakeupFunc(node, retcode)); /* call wake func
* explicitly since no
* I/O in this node */
rf_GenericWakeupFunc(node, retcode); /* call wake func
* explicitly since no
* I/O in this node */
}
/* this xor is used by the degraded-mode dag functions to recover lost
* data. the second-to-last parameter is the PDA for the failed
@ -507,7 +491,7 @@ rf_SimpleXorFunc(RF_DagNode_t *node)
* sectors in the failed PDA. It then uses the other PDAs in the
* parameter list to determine where within the target buffer the
* corresponding data should be xored. */
int
void
rf_RecoveryXorFunc(RF_DagNode_t *node)
{
RF_Raid_t *raidPtr = (RF_Raid_t *) node->params[node->numParams - 1].p;
@ -540,7 +524,7 @@ rf_RecoveryXorFunc(RF_DagNode_t *node)
tracerec->xor_us += RF_ETIMER_VAL_US(timer);
#endif
}
return (rf_GenericWakeupFunc(node, retcode));
rf_GenericWakeupFunc(node, retcode);
}
/*****************************************************************************
* The next three functions are utilities used by the above

View File

@ -1,4 +1,4 @@
/* $NetBSD: rf_dagfuncs.h,v 1.10 2006/01/09 01:33:27 oster Exp $ */
/* $NetBSD: rf_dagfuncs.h,v 1.11 2019/10/10 03:43:59 christos Exp $ */
/*
* Copyright (c) 1995 Carnegie-Mellon University.
* All rights reserved.
@ -36,24 +36,24 @@
#define _RF__RF_DAGFUNCS_H_
int rf_ConfigureDAGFuncs(RF_ShutdownList_t ** listp);
int rf_TerminateFunc(RF_DagNode_t * node);
int rf_TerminateUndoFunc(RF_DagNode_t * node);
int rf_DiskReadMirrorIdleFunc(RF_DagNode_t * node);
int rf_DiskReadMirrorPartitionFunc(RF_DagNode_t * node);
int rf_DiskReadMirrorUndoFunc(RF_DagNode_t * node);
int rf_ParityLogUpdateFunc(RF_DagNode_t * node);
int rf_ParityLogOverwriteFunc(RF_DagNode_t * node);
int rf_ParityLogUpdateUndoFunc(RF_DagNode_t * node);
int rf_ParityLogOverwriteUndoFunc(RF_DagNode_t * node);
int rf_NullNodeFunc(RF_DagNode_t * node);
int rf_NullNodeUndoFunc(RF_DagNode_t * node);
int rf_DiskReadFuncForThreads(RF_DagNode_t * node);
int rf_DiskWriteFuncForThreads(RF_DagNode_t * node);
int rf_DiskUndoFunc(RF_DagNode_t * node);
int rf_GenericWakeupFunc(RF_DagNode_t * node, int status);
int rf_RegularXorFunc(RF_DagNode_t * node);
int rf_SimpleXorFunc(RF_DagNode_t * node);
int rf_RecoveryXorFunc(RF_DagNode_t * node);
void rf_TerminateFunc(RF_DagNode_t * node);
void rf_TerminateUndoFunc(RF_DagNode_t * node);
void rf_DiskReadMirrorIdleFunc(RF_DagNode_t * node);
void rf_DiskReadMirrorPartitionFunc(RF_DagNode_t * node);
void rf_DiskReadMirrorUndoFunc(RF_DagNode_t * node);
void rf_ParityLogUpdateFunc(RF_DagNode_t * node);
void rf_ParityLogOverwriteFunc(RF_DagNode_t * node);
void rf_ParityLogUpdateUndoFunc(RF_DagNode_t * node);
void rf_ParityLogOverwriteUndoFunc(RF_DagNode_t * node);
void rf_NullNodeFunc(RF_DagNode_t * node);
void rf_NullNodeUndoFunc(RF_DagNode_t * node);
void rf_DiskReadFuncForThreads(RF_DagNode_t * node);
void rf_DiskWriteFuncForThreads(RF_DagNode_t * node);
void rf_DiskUndoFunc(RF_DagNode_t * node);
void rf_GenericWakeupFunc(void *, int);
void rf_RegularXorFunc(RF_DagNode_t * node);
void rf_SimpleXorFunc(RF_DagNode_t * node);
void rf_RecoveryXorFunc(RF_DagNode_t * node);
int
rf_XorIntoBuffer(RF_Raid_t * raidPtr, RF_PhysDiskAddr_t * pda, char *srcbuf,
char *targbuf);
@ -68,13 +68,13 @@ rf_bxor3(unsigned char *dst, unsigned char *a, unsigned char *b,
unsigned char *c, unsigned long len, void *bp);
/* function ptrs defined in ConfigureDAGFuncs() */
extern int (*rf_DiskReadFunc) (RF_DagNode_t *);
extern int (*rf_DiskWriteFunc) (RF_DagNode_t *);
extern int (*rf_DiskReadUndoFunc) (RF_DagNode_t *);
extern int (*rf_DiskWriteUndoFunc) (RF_DagNode_t *);
extern int (*rf_SimpleXorUndoFunc) (RF_DagNode_t *);
extern int (*rf_RegularXorUndoFunc) (RF_DagNode_t *);
extern int (*rf_RecoveryXorUndoFunc) (RF_DagNode_t *);
extern void (*rf_DiskReadFunc) (RF_DagNode_t *);
extern void (*rf_DiskWriteFunc) (RF_DagNode_t *);
extern void (*rf_DiskReadUndoFunc) (RF_DagNode_t *);
extern void (*rf_DiskWriteUndoFunc) (RF_DagNode_t *);
extern void (*rf_SimpleXorUndoFunc) (RF_DagNode_t *);
extern void (*rf_RegularXorUndoFunc) (RF_DagNode_t *);
extern void (*rf_RecoveryXorUndoFunc) (RF_DagNode_t *);
/* macros for manipulating the param[3] in a read or write node */
#define RF_CREATE_PARAM3(pri, wru) (((RF_uint64)(((wru&0xFFFFFF)<<8)|((pri)&0xF)) ))

View File

@ -1,4 +1,4 @@
/* $NetBSD: rf_dagutils.c,v 1.56 2019/02/10 17:13:33 christos Exp $ */
/* $NetBSD: rf_dagutils.c,v 1.57 2019/10/10 03:43:59 christos 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.56 2019/02/10 17:13:33 christos Exp $");
__KERNEL_RCSID(0, "$NetBSD: rf_dagutils.c,v 1.57 2019/10/10 03:43:59 christos Exp $");
#include <dev/raidframe/raidframevar.h>
@ -91,9 +91,9 @@ have a few kicking around.
*****************************************************************************/
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),
void (*doFunc) (RF_DagNode_t *node),
void (*undoFunc) (RF_DagNode_t *node),
void (*wakeFunc) (void *node, int status),
int nSucc, int nAnte, int nParam, int nResult,
RF_DagHeader_t *hdr, const char *name, RF_AllocListElem_t *alist)
{

View File

@ -1,4 +1,4 @@
/* $NetBSD: rf_dagutils.h,v 1.20 2005/12/11 12:23:37 christos Exp $ */
/* $NetBSD: rf_dagutils.h,v 1.21 2019/10/10 03:43:59 christos Exp $ */
/*
* Copyright (c) 1995 Carnegie-Mellon University.
* All rights reserved.
@ -42,9 +42,9 @@
#define _RF__RF_DAGUTILS_H_
struct RF_RedFuncs_s {
int (*regular) (RF_DagNode_t *);
void (*regular) (RF_DagNode_t *);
const char *RegularName;
int (*simple) (RF_DagNode_t *);
void (*simple) (RF_DagNode_t *);
const char *SimpleName;
};
@ -57,9 +57,9 @@ extern const RF_RedFuncs_t rf_xorFuncs;
extern const RF_RedFuncs_t rf_xorRecoveryFuncs;
void rf_InitNode(RF_DagNode_t *, RF_NodeStatus_t, int,
int (*) (RF_DagNode_t *),
int (*) (RF_DagNode_t *),
int (*) (RF_DagNode_t *, int),
void (*) (RF_DagNode_t *),
void (*) (RF_DagNode_t *),
void (*) (void *, int),
int, int, int, int, RF_DagHeader_t *,
const char *, RF_AllocListElem_t *);

View File

@ -1,4 +1,4 @@
/* $NetBSD: rf_desc.h,v 1.20 2007/03/04 06:02:36 christos Exp $ */
/* $NetBSD: rf_desc.h,v 1.21 2019/10/10 03:43:59 christos Exp $ */
/*
* Copyright (c) 1995 Carnegie-Mellon University.
* All rights reserved.
@ -87,7 +87,7 @@ struct RF_RaidAccessDesc_s {
struct buf *bp; /* buf pointer for this RAID acc */
RF_AccTraceEntry_t tracerec; /* perf monitoring information for a
* user access (not for dag stats) */
void (*callbackFunc) (RF_CBParam_t); /* callback function for this
void (*callbackFunc) (void *); /* callback function for this
* I/O */
void *callbackArg; /* arg to give to callback func */
RF_RaidAccessDesc_t *next;

View File

@ -1,4 +1,4 @@
/* $NetBSD: rf_diskqueue.c,v 1.55 2019/02/10 17:13:33 christos Exp $ */
/* $NetBSD: rf_diskqueue.c,v 1.56 2019/10/10 03:43:59 christos 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.55 2019/02/10 17:13:33 christos Exp $");
__KERNEL_RCSID(0, "$NetBSD: rf_diskqueue.c,v 1.56 2019/10/10 03:43:59 christos Exp $");
#include <dev/raidframe/raidframevar.h>
@ -360,7 +360,7 @@ rf_CreateDiskQueueData(RF_IoType_t typ, RF_SectorNum_t ssect,
RF_SectorCount_t nsect, void *bf,
RF_StripeNum_t parityStripeID,
RF_ReconUnitNum_t which_ru,
int (*wakeF) (void *, int), void *arg,
void (*wakeF) (void *, int), void *arg,
RF_AccTraceEntry_t *tracerec, RF_Raid_t *raidPtr,
RF_DiskQueueDataFlags_t flags, void *kb_proc,
int waitflag)

View File

@ -1,4 +1,4 @@
/* $NetBSD: rf_diskqueue.h,v 1.24 2011/05/05 06:04:09 mrg Exp $ */
/* $NetBSD: rf_diskqueue.h,v 1.25 2019/10/10 03:43:59 christos Exp $ */
/*
* Copyright (c) 1995 Carnegie-Mellon University.
* All rights reserved.
@ -62,7 +62,7 @@ struct RF_DiskQueueData_s {
* access is for */
RF_ReconUnitNum_t which_ru; /* which RU within this parity stripe */
int priority; /* the priority of this request */
int (*CompleteFunc) (void *, int); /* function to be called upon
void (*CompleteFunc) (void *, int); /* function to be called upon
* completion */
void *argument; /* argument to be passed to CompleteFunc */
RF_Raid_t *raidPtr; /* needed for simulation */
@ -141,7 +141,7 @@ int rf_DiskIOPromote(RF_DiskQueue_t *, RF_StripeNum_t, RF_ReconUnitNum_t);
RF_DiskQueueData_t *rf_CreateDiskQueueData(RF_IoType_t, RF_SectorNum_t,
RF_SectorCount_t , void *,
RF_StripeNum_t, RF_ReconUnitNum_t,
int (*wakeF) (void *, int),
void (*wakeF) (void *, int),
void *,
RF_AccTraceEntry_t *, RF_Raid_t *,
RF_DiskQueueDataFlags_t,

View File

@ -1,4 +1,4 @@
/* $NetBSD: rf_driver.c,v 1.135 2019/02/09 03:34:00 christos Exp $ */
/* $NetBSD: rf_driver.c,v 1.136 2019/10/10 03:43:59 christos Exp $ */
/*-
* Copyright (c) 1999 The NetBSD Foundation, Inc.
* All rights reserved.
@ -66,7 +66,7 @@
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: rf_driver.c,v 1.135 2019/02/09 03:34:00 christos Exp $");
__KERNEL_RCSID(0, "$NetBSD: rf_driver.c,v 1.136 2019/10/10 03:43:59 christos Exp $");
#ifdef _KERNEL_OPT
#include "opt_raid_diagnostic.h"
@ -812,7 +812,7 @@ rf_SuspendNewRequestsAndWait(RF_Raid_t *raidPtr)
void
rf_ResumeNewRequests(RF_Raid_t *raidPtr)
{
RF_CallbackDesc_t *t, *cb;
RF_CallbackFuncDesc_t *t, *cb;
#if RF_DEBUG_QUIESCE
if (rf_quiesceDebug)
@ -832,7 +832,7 @@ rf_ResumeNewRequests(RF_Raid_t *raidPtr)
t = cb;
cb = cb->next;
(t->callbackFunc) (t->callbackArg);
rf_FreeCallbackDesc(t);
rf_FreeCallbackFuncDesc(t);
}
}
/*****************************************************************************************

View File

@ -1,4 +1,4 @@
/* $NetBSD: rf_engine.c,v 1.52 2016/12/11 05:27:00 nat Exp $ */
/* $NetBSD: rf_engine.c,v 1.53 2019/10/10 03:43:59 christos 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.52 2016/12/11 05:27:00 nat Exp $");
__KERNEL_RCSID(0, "$NetBSD: rf_engine.c,v 1.53 2019/10/10 03:43:59 christos Exp $");
#include <sys/errno.h>
@ -684,14 +684,11 @@ ProcessNode(RF_DagNode_t *node, int context)
* This routine is called by each node execution function to mark the node
* as complete and fire off any successors that have been enabled.
*/
int
void
rf_FinishNode(RF_DagNode_t *node, int context)
{
int retcode = RF_FALSE;
node->dagHdr->numNodesCompleted++;
ProcessNode(node, context);
return (retcode);
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: rf_engine.h,v 1.6 2005/12/11 12:23:37 christos Exp $ */
/* $NetBSD: rf_engine.h,v 1.7 2019/10/10 03:43:59 christos Exp $ */
/*
* Copyright (c) 1995 Carnegie-Mellon University.
* All rights reserved.
@ -36,7 +36,7 @@
#define _RF__RF_ENGINE_H_
int rf_ConfigureEngine(RF_ShutdownList_t **, RF_Raid_t *, RF_Config_t *);
int rf_FinishNode(RF_DagNode_t *, int); /* return finished node to engine */
void rf_FinishNode(RF_DagNode_t *, int);/* return finished node to engine */
int rf_DispatchDAG(RF_DagHeader_t *,
void (*cbFunc) (void *), void *); /* execute dag */

View File

@ -1,4 +1,4 @@
/* $NetBSD: rf_evenodd_dagfuncs.c,v 1.23 2019/02/09 03:34:00 christos Exp $ */
/* $NetBSD: rf_evenodd_dagfuncs.c,v 1.24 2019/10/10 03:43:59 christos Exp $ */
/*
* Copyright (c) 1995 Carnegie-Mellon University.
* All rights reserved.
@ -31,7 +31,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: rf_evenodd_dagfuncs.c,v 1.23 2019/02/09 03:34:00 christos Exp $");
__KERNEL_RCSID(0, "$NetBSD: rf_evenodd_dagfuncs.c,v 1.24 2019/10/10 03:43:59 christos Exp $");
#include "rf_archs.h"
@ -66,14 +66,11 @@ RF_RedFuncs_t rf_eoERecoveryFuncs = {rf_RecoveryEFunc, "Recovery E Func", rf_Rec
/**********************************************************************************************
* the following encoding node functions is used in EO_000_CreateLargeWriteDAG
**********************************************************************************************/
int
void
rf_RegularPEFunc(RF_DagNode_t *node)
{
rf_RegularESubroutine(node, node->results[1]);
rf_RegularXorFunc(node);/* does the wakeup here! */
#if 1
return (0); /* XXX This was missing... GO */
#endif
}
@ -95,7 +92,7 @@ rf_RegularPEFunc(RF_DagNode_t *node)
old data and new data, then encode temp buf into old 'E' buf to form new 'E', but this approach
take the same speed as the previous, and need more memory.
*/
int
void
rf_RegularONEFunc(RF_DagNode_t *node)
{
RF_Raid_t *raidPtr = (RF_Raid_t *) node->params[node->numParams - 1].p;
@ -149,12 +146,9 @@ rf_RegularONEFunc(RF_DagNode_t *node)
RF_ETIMER_EVAL(timer);
tracerec->q_us += RF_ETIMER_VAL_US(timer);
rf_GenericWakeupFunc(node, 0);
#if 1
return (0); /* XXX this was missing.. GO */
#endif
}
int
void
rf_SimpleONEFunc(RF_DagNode_t *node)
{
RF_Raid_t *raidPtr = (RF_Raid_t *) node->params[node->numParams - 1].p;
@ -187,9 +181,9 @@ rf_SimpleONEFunc(RF_DagNode_t *node)
tracerec->q_us += RF_ETIMER_VAL_US(timer);
}
return (rf_GenericWakeupFunc(node, retcode)); /* call wake func
* explicitly since no
* I/O in this node */
rf_GenericWakeupFunc(node, retcode); /* call wake func
* explicitly since no
* I/O in this node */
}
@ -225,14 +219,11 @@ rf_RegularESubroutine(RF_DagNode_t *node, char *ebuf)
/*******************************************************************************************
* Used in EO_001_CreateLargeWriteDAG
******************************************************************************************/
int
void
rf_RegularEFunc(RF_DagNode_t *node)
{
rf_RegularESubroutine(node, node->results[0]);
rf_GenericWakeupFunc(node, 0);
#if 1
return (0); /* XXX this was missing?.. GO */
#endif
}
/*******************************************************************************************
* This degraded function allow only two case:
@ -283,15 +274,11 @@ rf_DegrESubroutine(RF_DagNode_t *node, char *ebuf)
* failed in the stripe but not accessed at this time, then we should, instead, use
* the rf_EOWriteDoubleRecoveryFunc().
**************************************************************************************/
int
void
rf_Degraded_100_EOFunc(RF_DagNode_t *node)
{
rf_DegrESubroutine(node, node->results[1]);
rf_RecoveryXorFunc(node); /* does the wakeup here! */
#if 1
return (0); /* XXX this was missing... SHould these be
* void functions??? GO */
#endif
}
/**************************************************************************************
* This function is to encode one sector in one of the data disks to the E disk.
@ -395,7 +382,7 @@ rf_e_encToBuf(
* to recover the data in dead disk. This function is used in the recovery node of
* for EO_110_CreateReadDAG
**************************************************************************************/
int
void
rf_RecoveryEFunc(RF_DagNode_t *node)
{
RF_Raid_t *raidPtr = (RF_Raid_t *) node->params[node->numParams - 1].p;
@ -432,20 +419,17 @@ rf_RecoveryEFunc(RF_DagNode_t *node)
RF_ETIMER_EVAL(timer);
tracerec->xor_us += RF_ETIMER_VAL_US(timer);
}
return (rf_GenericWakeupFunc(node, 0)); /* node execute successfully */
rf_GenericWakeupFunc(node, 0); /* node execute successfully */
}
/**************************************************************************************
* This function is used in the case where one data and the parity have filed.
* (in EO_110_CreateWriteDAG )
**************************************************************************************/
int
void
rf_EO_DegradedWriteEFunc(RF_DagNode_t * node)
{
rf_DegrESubroutine(node, node->results[0]);
rf_GenericWakeupFunc(node, 0);
#if 1
return (0); /* XXX Yet another one!! GO */
#endif
}
@ -643,7 +627,7 @@ rf_doubleEOdecode(
* EO_200_CreateReadDAG
*
***************************************************************************************/
int
void
rf_EvenOddDoubleRecoveryFunc(RF_DagNode_t *node)
{
int ndataParam = 0;
@ -828,9 +812,6 @@ rf_EvenOddDoubleRecoveryFunc(RF_DagNode_t *node)
tracerec->q_us += RF_ETIMER_VAL_US(timer);
}
rf_GenericWakeupFunc(node, 0);
#if 1
return (0); /* XXX is this even close!!?!?!!? GO */
#endif
}
@ -839,7 +820,7 @@ rf_EvenOddDoubleRecoveryFunc(RF_DagNode_t *node)
* many accesses of single stripe unit.
*/
int
void
rf_EOWriteDoubleRecoveryFunc(RF_DagNode_t *node)
{
int np = node->numParams;
@ -962,6 +943,5 @@ rf_EOWriteDoubleRecoveryFunc(RF_DagNode_t *node)
tracerec->q_us += RF_ETIMER_VAL_US(timer);
}
rf_GenericWakeupFunc(node, 0);
return (0);
}
#endif /* RF_INCLUDE_EVENODD > 0 */

View File

@ -1,4 +1,4 @@
/* $NetBSD: rf_evenodd_dagfuncs.h,v 1.5 2005/12/11 12:23:37 christos Exp $ */
/* $NetBSD: rf_evenodd_dagfuncs.h,v 1.6 2019/10/10 03:43:59 christos Exp $ */
/*
* rf_evenodd_dagfuncs.h
*/
@ -38,26 +38,26 @@ extern RF_RedFuncs_t rf_eoERecoveryFuncs;
extern RF_RedFuncs_t rf_eoPRecoveryFuncs;
extern RF_RedFuncs_t rf_eoERecoveryFuncs;
int rf_RegularPEFunc(RF_DagNode_t * node);
int rf_RegularONEFunc(RF_DagNode_t * node);
int rf_SimpleONEFunc(RF_DagNode_t * node);
void rf_RegularPEFunc(RF_DagNode_t * node);
void rf_RegularONEFunc(RF_DagNode_t * node);
void rf_SimpleONEFunc(RF_DagNode_t * node);
void rf_RegularESubroutine(RF_DagNode_t * node, char *ebuf);
int rf_RegularEFunc(RF_DagNode_t * node);
void rf_RegularEFunc(RF_DagNode_t * node);
void rf_DegrESubroutine(RF_DagNode_t * node, char *ebuf);
int rf_Degraded_100_EOFunc(RF_DagNode_t * node);
void rf_Degraded_100_EOFunc(RF_DagNode_t * node);
void
rf_e_EncOneSect(RF_RowCol_t srcLogicCol, char *srcSecbuf,
RF_RowCol_t destLogicCol, char *destSecbuf, int bytesPerSector);
void
rf_e_encToBuf(RF_Raid_t * raidPtr, RF_RowCol_t srcLogicCol,
char *srcbuf, RF_RowCol_t destLogicCol, char *destbuf, int numSector);
int rf_RecoveryEFunc(RF_DagNode_t * node);
int rf_EO_DegradedWriteEFunc(RF_DagNode_t * node);
void rf_RecoveryEFunc(RF_DagNode_t * node);
void rf_EO_DegradedWriteEFunc(RF_DagNode_t * node);
void
rf_doubleEOdecode(RF_Raid_t * raidPtr, char **rrdbuf, char **dest,
RF_RowCol_t * fcol, char *pbuf, char *ebuf);
int rf_EvenOddDoubleRecoveryFunc(RF_DagNode_t * node);
int rf_EOWriteDoubleRecoveryFunc(RF_DagNode_t * node);
void rf_EvenOddDoubleRecoveryFunc(RF_DagNode_t * node);
void rf_EOWriteDoubleRecoveryFunc(RF_DagNode_t * node);
#define rf_EUCol(_layoutPtr_, _addr_ ) \
( (_addr_)%( (_layoutPtr_)->dataSectorsPerStripe ) )/((_layoutPtr_)->sectorsPerStripeUnit)

View File

@ -1,4 +1,4 @@
/* $NetBSD: rf_evenodd_dags.c,v 1.4 2001/11/13 07:11:14 lukem Exp $ */
/* $NetBSD: rf_evenodd_dags.c,v 1.5 2019/10/10 03:43:59 christos Exp $ */
/*
* rf_evenodd_dags.c
*/
@ -30,7 +30,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: rf_evenodd_dags.c,v 1.4 2001/11/13 07:11:14 lukem Exp $");
__KERNEL_RCSID(0, "$NetBSD: rf_evenodd_dags.c,v 1.5 2019/10/10 03:43:59 christos Exp $");
#include "rf_archs.h"
@ -103,7 +103,7 @@ RF_CREATE_DAG_FUNC_DECL(rf_EO_100_CreateWriteDAG)
if (asmap->numStripeUnitsAccessed != 1 &&
asmap->failedPDAs[0]->numSector != raidPtr->Layout.sectorsPerStripeUnit)
RF_PANIC();
rf_CommonCreateSimpleDegradedWriteDAG(raidPtr, asmap, dag_h, bp, flags, allocList, 2, (int (*) (RF_DagNode_t *)) rf_Degraded_100_EOFunc, RF_TRUE);
rf_CommonCreateSimpleDegradedWriteDAG(raidPtr, asmap, dag_h, bp, flags, allocList, 2, rf_Degraded_100_EOFunc, RF_TRUE);
}
/*
* E is dead. Small write.
@ -162,7 +162,7 @@ RF_CREATE_DAG_FUNC_DECL(rf_EO_110_CreateWriteDAG)
temp = asmap->parityInfo;
asmap->parityInfo = asmap->qInfo;
asmap->qInfo = temp;
rf_CommonCreateSimpleDegradedWriteDAG(raidPtr, asmap, dag_h, bp, flags, allocList, 1, (int (*) (RF_DagNode_t *)) rf_EO_DegradedWriteEFunc, RF_FALSE);
rf_CommonCreateSimpleDegradedWriteDAG(raidPtr, asmap, dag_h, bp, flags, allocList, 1, rf_EO_DegradedWriteEFunc, RF_FALSE);
/* is the regular E func the right one to call? */
}
RF_CREATE_DAG_FUNC_DECL(rf_EO_101_CreateWriteDAG)

View File

@ -1,4 +1,4 @@
/* $NetBSD: rf_netbsd.h,v 1.33 2019/02/06 02:49:09 oster Exp $ */
/* $NetBSD: rf_netbsd.h,v 1.34 2019/10/10 03:43:59 christos Exp $ */
/*-
* Copyright (c) 1996, 1997, 1998 The NetBSD Foundation, Inc.
@ -61,7 +61,8 @@ struct RF_Pools_s {
struct pool asm_hdr; /* Access Stripe Map Header */
struct pool asmap; /* Access Stripe Map */
struct pool asmhle; /* Access Stripe Map Header List Elements */
struct pool callback; /* Callback descriptors */
struct pool callbackf; /* Callback function descriptors */
struct pool callbackv; /* Callback value descriptors */
struct pool dagh; /* DAG headers */
struct pool dagnode; /* DAG nodes */
struct pool daglist; /* DAG lists */

View File

@ -1,4 +1,4 @@
/* $NetBSD: rf_paritylog.c,v 1.19 2019/02/09 03:34:00 christos Exp $ */
/* $NetBSD: rf_paritylog.c,v 1.20 2019/10/10 03:43:59 christos Exp $ */
/*
* Copyright (c) 1995 Carnegie-Mellon University.
* All rights reserved.
@ -31,7 +31,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: rf_paritylog.c,v 1.19 2019/02/09 03:34:00 christos Exp $");
__KERNEL_RCSID(0, "$NetBSD: rf_paritylog.c,v 1.20 2019/10/10 03:43:59 christos Exp $");
#include "rf_archs.h"
@ -262,7 +262,7 @@ rf_CreateParityLogData(
RF_PhysDiskAddr_t * pda,
void *bufPtr,
RF_Raid_t * raidPtr,
int (*wakeFunc) (RF_DagNode_t * node, int status),
void (*wakeFunc)(void *, int),
void *wakeArg,
RF_AccTraceEntry_t * tracerec,
RF_Etimer_t startTime)
@ -669,7 +669,7 @@ rf_ParityLogAppend(
RF_ParityLog_t *log;
RF_Raid_t *raidPtr;
RF_Etimer_t timer;
int (*wakeFunc) (RF_DagNode_t * node, int status);
void (*wakeFunc) (void *, int);
void *wakeArg;
/* Add parity to the appropriate log, one sector at a time. This

View File

@ -1,4 +1,4 @@
/* $NetBSD: rf_paritylog.h,v 1.12 2011/05/11 18:13:12 mrg Exp $ */
/* $NetBSD: rf_paritylog.h,v 1.13 2019/10/10 03:43:59 christos Exp $ */
/*
* Copyright (c) 1995 Carnegie-Mellon University.
* All rights reserved.
@ -49,8 +49,7 @@ struct RF_CommonLogData_s {
rf_declare_mutex2(mutex); /* protects cnt */
int cnt; /* when 0, time to call wakeFunc */
RF_Raid_t *raidPtr;
/* int (*wakeFunc)(struct buf *); */
int (*wakeFunc) (RF_DagNode_t * node, int status);
void (*wakeFunc) (void *, int);
void *wakeArg;
RF_AccTraceEntry_t *tracerec;
RF_Etimer_t startTime;
@ -166,7 +165,7 @@ struct RF_RegionInfo_s {
RF_ParityLogData_t *
rf_CreateParityLogData(RF_ParityRecordType_t operation,
RF_PhysDiskAddr_t * pda, void *bufPtr, RF_Raid_t * raidPtr,
int (*wakeFunc) (RF_DagNode_t * node, int status),
void (*wakeFunc) (void *, int),
void *wakeArg, RF_AccTraceEntry_t * tracerec,
RF_Etimer_t startTime);
RF_ParityLogData_t *rf_SearchAndDequeueParityLogData(RF_Raid_t * raidPtr,

View File

@ -1,4 +1,4 @@
/* $NetBSD: rf_paritylogDiskMgr.c,v 1.29 2019/02/09 03:34:00 christos Exp $ */
/* $NetBSD: rf_paritylogDiskMgr.c,v 1.30 2019/10/10 03:43:59 christos Exp $ */
/*
* Copyright (c) 1995 Carnegie-Mellon University.
* All rights reserved.
@ -30,7 +30,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: rf_paritylogDiskMgr.c,v 1.29 2019/02/09 03:34:00 christos Exp $");
__KERNEL_RCSID(0, "$NetBSD: rf_paritylogDiskMgr.c,v 1.30 2019/10/10 03:43:59 christos Exp $");
#include "rf_archs.h"
@ -583,9 +583,10 @@ rf_ShutdownLogging(RF_Raid_t * raidPtr)
return (0);
}
int
rf_ParityLoggingDiskManager(RF_Raid_t * raidPtr)
void
rf_ParityLoggingDiskManager(void *v)
{
RF_Raid_t *raidPtr = v;
RF_ParityLog_t *reintQueue, *flushQueue;
int workNeeded, done = RF_FALSE;
int s;

View File

@ -1,4 +1,4 @@
/* $NetBSD: rf_paritylogDiskMgr.h,v 1.4 2001/10/04 15:58:55 oster Exp $ */
/* $NetBSD: rf_paritylogDiskMgr.h,v 1.5 2019/10/10 03:43:59 christos Exp $ */
/*
* Copyright (c) 1995 Carnegie-Mellon University.
* All rights reserved.
@ -36,6 +36,6 @@
#include <dev/raidframe/raidframevar.h>
int rf_ShutdownLogging(RF_Raid_t * raidPtr);
int rf_ParityLoggingDiskManager(RF_Raid_t * raidPtr);
void rf_ParityLoggingDiskManager(void *);
#endif /* !_RF__RF_PARITYLOGDISKMGR_H_ */

View File

@ -1,4 +1,4 @@
/* $NetBSD: rf_parityloggingdags.c,v 1.22 2019/02/09 03:34:00 christos Exp $ */
/* $NetBSD: rf_parityloggingdags.c,v 1.23 2019/10/10 03:43:59 christos Exp $ */
/*
* Copyright (c) 1995 Carnegie-Mellon University.
* All rights reserved.
@ -31,7 +31,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: rf_parityloggingdags.c,v 1.22 2019/02/09 03:34:00 christos Exp $");
__KERNEL_RCSID(0, "$NetBSD: rf_parityloggingdags.c,v 1.23 2019/10/10 03:43:59 christos Exp $");
#ifdef _KERNEL_OPT
#include "opt_raid_diagnostic.h"
@ -82,7 +82,7 @@ rf_CommonCreateParityLoggingLargeWriteDAG(
RF_RaidAccessFlags_t flags,
RF_AllocListElem_t * allocList,
int nfaults,
int (*redFunc) (RF_DagNode_t *))
void (*redFunc) (RF_DagNode_t *))
{
RF_DagNode_t *nodes, *wndNodes, *rodNodes = NULL, *syncNode, *xorNode,
*lpoNode, *blockNode, *unblockNode, *termNode;
@ -337,7 +337,7 @@ rf_CommonCreateParityLoggingSmallWriteDAG(
int numParityNodes = (asmap->parityInfo->next) ? 2 : 1;
int i, j, nNodes, totalNumNodes;
RF_ReconUnitNum_t which_ru;
int (*func) (RF_DagNode_t * node), (*undoFunc) (RF_DagNode_t * node);
void (*func) (RF_DagNode_t * node), (*undoFunc) (RF_DagNode_t * node);
const char *name;
RF_StripeNum_t parityStripeID = rf_RaidAddressToParityStripeID(&(raidPtr->Layout), asmap->raidAddress, &which_ru);
long nfaults __unused = qfuncs ? 2 : 1;
@ -633,7 +633,7 @@ rf_CreateParityLoggingLargeWriteDAG(
RF_RaidAccessFlags_t flags,
RF_AllocListElem_t * allocList,
int nfaults,
int (*redFunc) (RF_DagNode_t *))
void (*redFunc) (RF_DagNode_t *))
{
dag_h->creator = "ParityLoggingSmallWriteDAG";
rf_CommonCreateParityLoggingLargeWriteDAG(raidPtr, asmap, dag_h, bp, flags, allocList, 1, rf_RegularXorFunc);

View File

@ -1,4 +1,4 @@
/* $NetBSD: rf_parityloggingdags.h,v 1.6 2006/08/17 17:11:28 christos Exp $ */
/* $NetBSD: rf_parityloggingdags.h,v 1.7 2019/10/10 03:43:59 christos Exp $ */
/*
* Copyright (c) 1995 Carnegie-Mellon University.
* All rights reserved.
@ -39,7 +39,7 @@
void rf_CommonCreateParityLoggingLargeWriteDAG(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 nfaults, void (*redFunc) (RF_DagNode_t *));
void rf_CommonCreateParityLoggingSmallWriteDAG(RF_Raid_t * raidPtr,
RF_AccessStripeMap_t * asmap, RF_DagHeader_t * dag_h,
@ -49,7 +49,7 @@ void rf_CommonCreateParityLoggingSmallWriteDAG(RF_Raid_t * raidPtr,
void rf_CreateParityLoggingLargeWriteDAG(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 nfaults, void (*redFunc) (RF_DagNode_t *));
void rf_CreateParityLoggingSmallWriteDAG(RF_Raid_t * raidPtr,
RF_AccessStripeMap_t * asmap, RF_DagHeader_t * dag_h,

View File

@ -1,4 +1,4 @@
/* $NetBSD: rf_parityscan.c,v 1.35 2019/02/09 03:34:00 christos Exp $ */
/* $NetBSD: rf_parityscan.c,v 1.36 2019/10/10 03:43:59 christos Exp $ */
/*
* Copyright (c) 1995 Carnegie-Mellon University.
* All rights reserved.
@ -33,7 +33,7 @@
****************************************************************************/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: rf_parityscan.c,v 1.35 2019/02/09 03:34:00 christos Exp $");
__KERNEL_RCSID(0, "$NetBSD: rf_parityscan.c,v 1.36 2019/10/10 03:43:59 christos Exp $");
#include <dev/raidframe/raidframevar.h>
@ -417,8 +417,8 @@ rf_VerifyDegrModeWrite(RF_Raid_t *raidPtr, RF_AccessStripeMapHeader_t *asmh)
*/
RF_DagHeader_t *
rf_MakeSimpleDAG(RF_Raid_t *raidPtr, int nNodes, int bytesPerSU, char *databuf,
int (*doFunc) (RF_DagNode_t * node),
int (*undoFunc) (RF_DagNode_t * node),
void (*doFunc) (RF_DagNode_t * node),
void (*undoFunc) (RF_DagNode_t * node),
const char *name, RF_AllocListElem_t *alloclist,
RF_RaidAccessFlags_t flags, int priority)
{

View File

@ -1,4 +1,4 @@
/* $NetBSD: rf_parityscan.h,v 1.8 2009/11/17 18:54:26 jld Exp $ */
/* $NetBSD: rf_parityscan.h,v 1.9 2019/10/10 03:43:59 christos Exp $ */
/*
* Copyright (c) 1995 Carnegie-Mellon University.
* All rights reserved.
@ -42,7 +42,7 @@ int rf_VerifyParity(RF_Raid_t *, RF_AccessStripeMap_t *, int,
int rf_TryToRedirectPDA(RF_Raid_t *, RF_PhysDiskAddr_t *, int);
int rf_VerifyDegrModeWrite(RF_Raid_t *, RF_AccessStripeMapHeader_t *);
RF_DagHeader_t *rf_MakeSimpleDAG(RF_Raid_t *, int, int, char *,
int (*)(RF_DagNode_t *), int (*) (RF_DagNode_t *), const char *,
void (*)(RF_DagNode_t *), void (*) (RF_DagNode_t *), const char *,
RF_AllocListElem_t *, RF_RaidAccessFlags_t, int);
#define RF_DO_CORRECT_PARITY 1

View File

@ -1,4 +1,4 @@
/* $NetBSD: rf_pq.c,v 1.16 2009/03/14 15:36:20 dsl Exp $ */
/* $NetBSD: rf_pq.c,v 1.17 2019/10/10 03:43:59 christos Exp $ */
/*
* Copyright (c) 1995 Carnegie-Mellon University.
* All rights reserved.
@ -31,7 +31,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: rf_pq.c,v 1.16 2009/03/14 15:36:20 dsl Exp $");
__KERNEL_RCSID(0, "$NetBSD: rf_pq.c,v 1.17 2019/10/10 03:43:59 christos Exp $");
#include "rf_archs.h"
@ -56,31 +56,31 @@ __KERNEL_RCSID(0, "$NetBSD: rf_pq.c,v 1.16 2009/03/14 15:36:20 dsl Exp $");
RF_RedFuncs_t rf_pFuncs = {rf_RegularONPFunc, "Regular Old-New P", rf_SimpleONPFunc, "Simple Old-New P"};
RF_RedFuncs_t rf_pRecoveryFuncs = {rf_RecoveryPFunc, "Recovery P Func", rf_RecoveryPFunc, "Recovery P Func"};
int
void
rf_RegularONPFunc(RF_DagNode_t *node)
{
return (rf_RegularXorFunc(node));
rf_RegularXorFunc(node);
}
/*
same as simpleONQ func, but the coefficient is always 1
*/
int
void
rf_SimpleONPFunc(RF_DagNode_t *node)
{
return (rf_SimpleXorFunc(node));
rf_SimpleXorFunc(node);
}
int
void
rf_RecoveryPFunc(RF_DagNode_t *node)
{
return (rf_RecoveryXorFunc(node));
rf_RecoveryXorFunc(node);
}
int
void
rf_RegularPFunc(RF_DagNode_t *node)
{
return (rf_RegularXorFunc(node));
rf_RegularXorFunc(node);
}
#endif /* (RF_INCLUDE_DECL_PQ > 0) || (RF_INCLUDE_RAID6 > 0) || (RF_INCLUDE_EVENODD > 0) */
#if (RF_INCLUDE_DECL_PQ > 0) || (RF_INCLUDE_RAID6 > 0)

View File

@ -1,4 +1,4 @@
/* $NetBSD: rf_pq.h,v 1.5 2005/12/11 12:23:37 christos Exp $ */
/* $NetBSD: rf_pq.h,v 1.6 2019/10/10 03:43:59 christos Exp $ */
/*
* rf_pq.h
*/
@ -37,10 +37,10 @@
extern RF_RedFuncs_t rf_pFuncs;
extern RF_RedFuncs_t rf_pRecoveryFuncs;
int rf_RegularONPFunc(RF_DagNode_t * node);
int rf_SimpleONPFunc(RF_DagNode_t * node);
int rf_RecoveryPFunc(RF_DagNode_t * node);
int rf_RegularPFunc(RF_DagNode_t * node);
void rf_RegularONPFunc(RF_DagNode_t * node);
void rf_SimpleONPFunc(RF_DagNode_t * node);
void rf_RecoveryPFunc(RF_DagNode_t * node);
void rf_RegularPFunc(RF_DagNode_t * node);
#if (RF_INCLUDE_DECL_PQ > 0) || (RF_INCLUDE_RAID6 > 0)
@ -52,14 +52,14 @@ void
rf_PQDagSelect(RF_Raid_t * raidPtr, RF_IoType_t type,
RF_AccessStripeMap_t * asmap, RF_VoidFuncPtr * createFunc);
RF_CREATE_DAG_FUNC_DECL(rf_PQCreateLargeWriteDAG);
int rf_RegularONQFunc(RF_DagNode_t * node);
int rf_SimpleONQFunc(RF_DagNode_t * node);
void rf_RegularONQFunc(RF_DagNode_t * node);
void rf_SimpleONQFunc(RF_DagNode_t * node);
RF_CREATE_DAG_FUNC_DECL(rf_PQCreateSmallWriteDAG);
int rf_RegularPQFunc(RF_DagNode_t * node);
int rf_RegularQFunc(RF_DagNode_t * node);
void rf_RegularPQFunc(RF_DagNode_t * node);
void rf_RegularQFunc(RF_DagNode_t * node);
void rf_Degraded_100_PQFunc(RF_DagNode_t * node);
int rf_RecoveryQFunc(RF_DagNode_t * node);
int rf_RecoveryPQFunc(RF_DagNode_t * node);
void rf_RecoveryQFunc(RF_DagNode_t * node);
void rf_RecoveryPQFunc(RF_DagNode_t * node);
void rf_PQ_DegradedWriteQFunc(RF_DagNode_t * node);
void
rf_IncQ(unsigned long *dest, unsigned long *buf, unsigned length,

View File

@ -1,4 +1,4 @@
/* $NetBSD: rf_psstatus.c,v 1.36 2019/02/10 17:13:33 christos Exp $ */
/* $NetBSD: rf_psstatus.c,v 1.37 2019/10/10 03:43:59 christos 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.36 2019/02/10 17:13:33 christos Exp $");
__KERNEL_RCSID(0, "$NetBSD: rf_psstatus.c,v 1.37 2019/10/10 03:43:59 christos Exp $");
#include <dev/raidframe/raidframevar.h>
@ -220,7 +220,7 @@ rf_RemoveFromActiveReconTable(RF_Raid_t *raidPtr, RF_StripeNum_t psid,
{
RF_PSStatusHeader_t *hdr = &(raidPtr->reconControl->pssTable[RF_HASH_PSID(raidPtr, psid)]);
RF_ReconParityStripeStatus_t *p, *pt;
RF_CallbackDesc_t *cb, *cb1;
RF_CallbackFuncDesc_t *cb, *cb1;
rf_lock_mutex2(hdr->mutex);
while(hdr->lock) {
@ -257,7 +257,7 @@ rf_RemoveFromActiveReconTable(RF_Raid_t *raidPtr, RF_StripeNum_t psid,
Dprintf1("Waking up access waiting on parity stripe ID %ld\n", p->parityStripeID);
cb1 = cb->next;
(cb->callbackFunc) (cb->callbackArg);
rf_FreeCallbackDesc(cb);
rf_FreeCallbackFuncDesc(cb);
cb = cb1;
}
@ -285,17 +285,18 @@ RealPrintPSStatusTable(RF_Raid_t *raidPtr, RF_PSStatusHeader_t *pssTable)
{
int i, j, procsWaiting, blocksWaiting, bufsWaiting;
RF_ReconParityStripeStatus_t *p;
RF_CallbackDesc_t *cb;
RF_CallbackValueDesc_t *vb;
RF_CallbackFuncDesc_t *fb;
printf("\nParity Stripe Status Table\n");
for (i = 0; i < raidPtr->pssTableSize; i++) {
for (p = pssTable[i].chain; p; p = p->next) {
procsWaiting = blocksWaiting = bufsWaiting = 0;
for (cb = p->procWaitList; cb; cb = cb->next)
for (fb = p->procWaitList; fb; fb = fb->next)
procsWaiting++;
for (cb = p->blockWaitList; cb; cb = cb->next)
for (vb = p->blockWaitList; vb; vb = vb->next)
blocksWaiting++;
for (cb = p->bufWaitList; cb; cb = cb->next)
for (vb = p->bufWaitList; vb; vb = vb->next)
bufsWaiting++;
printf("PSID %ld RU %d : blockCount %d %d/%d/%d proc/block/buf waiting, issued ",
(long) p->parityStripeID, p->which_ru, p->blockCount, procsWaiting, blocksWaiting, bufsWaiting);

View File

@ -1,4 +1,4 @@
/* $NetBSD: rf_psstatus.h,v 1.14 2011/05/03 08:18:43 mrg Exp $ */
/* $NetBSD: rf_psstatus.h,v 1.15 2019/10/10 03:43:59 christos Exp $ */
/*
* Copyright (c) 1995 Carnegie-Mellon University.
* All rights reserved.
@ -87,12 +87,12 @@ struct RF_ReconParityStripeStatus_s {
* this parity stripe */
char issued[RF_MAXCOL]; /* issued[i]==1 <=> column i has already
* issued a read request for the indicated RU */
RF_CallbackDesc_t *procWaitList; /* list of user procs waiting
RF_CallbackFuncDesc_t *procWaitList; /* list of user procs waiting
* for recon to be done */
RF_CallbackDesc_t *blockWaitList; /* list of disks blocked
RF_CallbackValueDesc_t *blockWaitList; /* list of disks blocked
* waiting for user write to
* complete */
RF_CallbackDesc_t *bufWaitList; /* list of disks blocked waiting to
RF_CallbackValueDesc_t *bufWaitList; /* list of disks blocked waiting to
* acquire a buffer for this RU */
RF_ReconParityStripeStatus_t *next;
};

View File

@ -1,4 +1,4 @@
/* $NetBSD: rf_raid.h,v 1.47 2019/02/06 02:49:09 oster Exp $ */
/* $NetBSD: rf_raid.h,v 1.48 2019/10/10 03:43:59 christos Exp $ */
/*
* Copyright (c) 1995 Carnegie-Mellon University.
* All rights reserved.
@ -201,7 +201,7 @@ struct RF_Raid_s {
RF_IoCount_t accs_in_flight;
int access_suspend_release;
int waiting_for_quiescence;
RF_CallbackDesc_t *quiesce_wait_list;
RF_CallbackFuncDesc_t *quiesce_wait_list;
/*
* Statistics

View File

@ -1,4 +1,4 @@
/* $NetBSD: rf_raid1.c,v 1.36 2019/02/09 03:34:00 christos Exp $ */
/* $NetBSD: rf_raid1.c,v 1.37 2019/10/10 03:43:59 christos 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.36 2019/02/09 03:34:00 christos Exp $");
__KERNEL_RCSID(0, "$NetBSD: rf_raid1.c,v 1.37 2019/10/10 03:43:59 christos Exp $");
#include "rf_raid.h"
#include "rf_raid1.h"
@ -551,7 +551,7 @@ rf_SubmitReconBufferRAID1(RF_ReconBuffer_t *rbuf, int keep_it,
RF_ReconParityStripeStatus_t *pssPtr;
RF_ReconCtrl_t *reconCtrlPtr;
int retcode;
RF_CallbackDesc_t *cb, *p;
RF_CallbackValueDesc_t *cb, *p;
RF_ReconBuffer_t *t;
RF_Raid_t *raidPtr;
void *ta;
@ -646,9 +646,9 @@ rf_SubmitReconBufferRAID1(RF_ReconBuffer_t *rbuf, int keep_it,
RF_PANIC();
}
pssPtr->flags |= RF_PSS_BUFFERWAIT;
cb = rf_AllocCallbackDesc();
cb = rf_AllocCallbackValueDesc();
cb->col = rbuf->col;
cb->callbackArg.v = rbuf->parityStripeID;
cb->v = rbuf->parityStripeID;
cb->next = NULL;
if (reconCtrlPtr->bufferWaitList == NULL) {
/* we are the wait list- lucky us */

View File

@ -1,4 +1,4 @@
/* $NetBSD: rf_reconbuffer.c,v 1.25 2011/05/02 07:29:18 mrg Exp $ */
/* $NetBSD: rf_reconbuffer.c,v 1.26 2019/10/10 03:43:59 christos 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.25 2011/05/02 07:29:18 mrg Exp $");
__KERNEL_RCSID(0, "$NetBSD: rf_reconbuffer.c,v 1.26 2019/10/10 03:43:59 christos Exp $");
#include "rf_raid.h"
#include "rf_reconbuffer.h"
@ -126,7 +126,7 @@ rf_SubmitReconBufferBasic(RF_ReconBuffer_t *rbuf, int keep_it,
RF_ReconBuffer_t *targetRbuf, *t = NULL; /* temporary rbuf
* pointers */
void *ta; /* temporary data buffer pointer */
RF_CallbackDesc_t *cb, *p;
RF_CallbackValueDesc_t *cb, *p;
int retcode = 0;
RF_Etimer_t timer;
@ -233,10 +233,10 @@ rf_SubmitReconBufferBasic(RF_ReconBuffer_t *rbuf, int keep_it,
RF_PANIC();
}
pssPtr->flags |= RF_PSS_BUFFERWAIT;
cb = rf_AllocCallbackDesc(); /* append to buf wait list in
cb = rf_AllocCallbackValueDesc();/* append to buf wait list in
* recon ctrl structure */
cb->col = rbuf->col;
cb->callbackArg.v = rbuf->parityStripeID;
cb->v = rbuf->parityStripeID;
cb->next = NULL;
if (!reconCtrlPtr->bufferWaitList)
reconCtrlPtr->bufferWaitList = cb;
@ -399,7 +399,7 @@ void
rf_ReleaseFloatingReconBuffer(RF_Raid_t *raidPtr, RF_ReconBuffer_t *rbuf)
{
RF_ReconCtrl_t *rcPtr = raidPtr->reconControl;
RF_CallbackDesc_t *cb;
RF_CallbackValueDesc_t *cb;
Dprintf2("RECON: releasing rbuf for psid %ld ru %d\n",
(long) rbuf->parityStripeID, rbuf->which_ru);
@ -413,7 +413,7 @@ rf_ReleaseFloatingReconBuffer(RF_Raid_t *raidPtr, RF_ReconBuffer_t *rbuf)
rcPtr->bufferWaitList = cb->next;
rf_CauseReconEvent(raidPtr, cb->col, (void *) 1, RF_REVENT_BUFCLEAR); /* arg==1 => we've
* committed a buffer */
rf_FreeCallbackDesc(cb);
rf_FreeCallbackValueDesc(cb);
raidPtr->procsInBufWait--;
} else {
rbuf->next = rcPtr->floatingRbufs;

View File

@ -1,4 +1,4 @@
/* $NetBSD: rf_reconstruct.c,v 1.122 2019/02/09 03:34:00 christos Exp $ */
/* $NetBSD: rf_reconstruct.c,v 1.123 2019/10/10 03:43:59 christos 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.122 2019/02/09 03:34:00 christos Exp $");
__KERNEL_RCSID(0, "$NetBSD: rf_reconstruct.c,v 1.123 2019/10/10 03:43:59 christos Exp $");
#include <sys/param.h>
#include <sys/time.h>
@ -115,8 +115,8 @@ static int ComputePSDiskOffsets(RF_Raid_t *, RF_StripeNum_t, RF_RowCol_t,
RF_SectorNum_t *, RF_SectorNum_t *, RF_RowCol_t *,
RF_SectorNum_t *);
static int IssueNextWriteRequest(RF_Raid_t *);
static int ReconReadDoneProc(void *, int);
static int ReconWriteDoneProc(void *, int);
static void ReconReadDoneProc(void *, int);
static void ReconWriteDoneProc(void *, int);
static void CheckForNewMinHeadSep(RF_Raid_t *, RF_HeadSepLimit_t);
static int CheckHeadSeparation(RF_Raid_t *, RF_PerDiskReconCtrl_t *,
RF_RowCol_t, RF_HeadSepLimit_t,
@ -1516,7 +1516,7 @@ IssueNextWriteRequest(RF_Raid_t *raidPtr)
* called at interrupt context in the kernel, so don't do anything
* illegal here.
*/
static int
static void
ReconReadDoneProc(void *arg, int status)
{
RF_PerDiskReconCtrl_t *ctrl = (RF_PerDiskReconCtrl_t *) arg;
@ -1527,14 +1527,14 @@ ReconReadDoneProc(void *arg, int status)
There won't be anyone listening for this event anyway */
if (ctrl->reconCtrl == NULL)
return(0);
return;
raidPtr = ctrl->reconCtrl->reconDesc->raidPtr;
if (status) {
printf("raid%d: Recon read failed: %d\n", raidPtr->raidid, status);
rf_CauseReconEvent(raidPtr, ctrl->col, NULL, RF_REVENT_READ_FAILED);
return(0);
return;
}
#if RF_ACC_TRACE > 0
RF_ETIMER_STOP(raidPtr->recon_tracerecs[ctrl->col].recon_timer);
@ -1544,14 +1544,14 @@ ReconReadDoneProc(void *arg, int status)
RF_ETIMER_START(raidPtr->recon_tracerecs[ctrl->col].recon_timer);
#endif
rf_CauseReconEvent(raidPtr, ctrl->col, NULL, RF_REVENT_READDONE);
return (0);
return;
}
/* this gets called upon the completion of a reconstruction write operation.
* the arg is a pointer to the rbuf that was just written
*
* called at interrupt context in the kernel, so don't do anything illegal here.
*/
static int
static void
ReconWriteDoneProc(void *arg, int status)
{
RF_ReconBuffer_t *rbuf = (RF_ReconBuffer_t *) arg;
@ -1561,16 +1561,15 @@ ReconWriteDoneProc(void *arg, int status)
There won't be anyone listening for this event anyway */
if (rbuf->raidPtr->reconControl == NULL)
return(0);
return;
Dprintf2("Reconstruction completed on psid %ld ru %d\n", rbuf->parityStripeID, rbuf->which_ru);
if (status) {
printf("raid%d: Recon write failed (status %d(0x%x))!\n", rbuf->raidPtr->raidid,status,status);
rf_CauseReconEvent(rbuf->raidPtr, rbuf->col, arg, RF_REVENT_WRITE_FAILED);
return(0);
return;
}
rf_CauseReconEvent(rbuf->raidPtr, rbuf->col, arg, RF_REVENT_WRITEDONE);
return (0);
}
@ -1584,7 +1583,7 @@ CheckForNewMinHeadSep(RF_Raid_t *raidPtr, RF_HeadSepLimit_t hsCtr)
RF_ReconCtrl_t *reconCtrlPtr = raidPtr->reconControl;
RF_HeadSepLimit_t new_min;
RF_RowCol_t i;
RF_CallbackDesc_t *p;
RF_CallbackValueDesc_t *p;
RF_ASSERT(hsCtr >= reconCtrlPtr->minHeadSepCounter); /* from the definition
* of a minimum */
@ -1607,13 +1606,13 @@ CheckForNewMinHeadSep(RF_Raid_t *raidPtr, RF_HeadSepLimit_t hsCtr)
reconCtrlPtr->minHeadSepCounter = new_min;
Dprintf1("RECON: new min head pos counter val is %ld\n", new_min);
while (reconCtrlPtr->headSepCBList) {
if (reconCtrlPtr->headSepCBList->callbackArg.v > new_min)
if (reconCtrlPtr->headSepCBList->v > new_min)
break;
p = reconCtrlPtr->headSepCBList;
reconCtrlPtr->headSepCBList = p->next;
p->next = NULL;
rf_CauseReconEvent(raidPtr, p->col, NULL, RF_REVENT_HEADSEPCLEAR);
rf_FreeCallbackDesc(p);
rf_FreeCallbackValueDesc(p);
}
}
@ -1641,7 +1640,7 @@ CheckHeadSeparation(RF_Raid_t *raidPtr, RF_PerDiskReconCtrl_t *ctrl,
RF_ReconUnitNum_t which_ru)
{
RF_ReconCtrl_t *reconCtrlPtr = raidPtr->reconControl;
RF_CallbackDesc_t *cb, *p, *pt;
RF_CallbackValueDesc_t *cb, *p, *pt;
int retval = 0;
/* if we're too far ahead of the slowest disk, stop working on this
@ -1664,10 +1663,10 @@ CheckHeadSeparation(RF_Raid_t *raidPtr, RF_PerDiskReconCtrl_t *ctrl,
raidPtr->raidid, col, ctrl->headSepCounter,
reconCtrlPtr->minHeadSepCounter,
raidPtr->headSepLimit);
cb = rf_AllocCallbackDesc();
cb = rf_AllocCallbackValueDesc();
/* the minHeadSepCounter value we have to get to before we'll
* wake up. build in 20% hysteresis. */
cb->callbackArg.v = (ctrl->headSepCounter - raidPtr->headSepLimit + raidPtr->headSepLimit / 5);
cb->v = (ctrl->headSepCounter - raidPtr->headSepLimit + raidPtr->headSepLimit / 5);
cb->col = col;
cb->next = NULL;
@ -1677,11 +1676,11 @@ CheckHeadSeparation(RF_Raid_t *raidPtr, RF_PerDiskReconCtrl_t *ctrl,
if (!p)
reconCtrlPtr->headSepCBList = cb;
else
if (cb->callbackArg.v < p->callbackArg.v) {
if (cb->v < p->v) {
cb->next = reconCtrlPtr->headSepCBList;
reconCtrlPtr->headSepCBList = cb;
} else {
for (pt = p, p = p->next; p && (p->callbackArg.v < cb->callbackArg.v); pt = p, p = p->next);
for (pt = p, p = p->next; p && (p->v < cb->v); pt = p, p = p->next);
cb->next = p;
pt->next = cb;
}
@ -1712,7 +1711,7 @@ CheckForcedOrBlockedReconstruction(RF_Raid_t *raidPtr,
RF_StripeNum_t psid,
RF_ReconUnitNum_t which_ru)
{
RF_CallbackDesc_t *cb;
RF_CallbackValueDesc_t *cb;
int retcode = 0;
if ((pssPtr->flags & RF_PSS_FORCED_ON_READ) || (pssPtr->flags & RF_PSS_FORCED_ON_WRITE))
@ -1720,7 +1719,7 @@ CheckForcedOrBlockedReconstruction(RF_Raid_t *raidPtr,
else
if (pssPtr->flags & RF_PSS_RECON_BLOCKED) {
Dprintf3("RECON: col %d blocked at psid %ld ru %d\n", col, psid, which_ru);
cb = rf_AllocCallbackDesc(); /* append ourselves to
cb = rf_AllocCallbackValueDesc(); /* append ourselves to
* the blockage-wait
* list */
cb->col = col;
@ -1744,7 +1743,7 @@ CheckForcedOrBlockedReconstruction(RF_Raid_t *raidPtr,
*/
int
rf_ForceOrBlockRecon(RF_Raid_t *raidPtr, RF_AccessStripeMap_t *asmap,
void (*cbFunc)(RF_Raid_t *, void *), void *cbArg)
void (*cbFunc)(void *), void *cbArg)
{
RF_StripeNum_t stripeID = asmap->stripeID; /* the stripe ID we're
* forcing recon on */
@ -1759,7 +1758,7 @@ rf_ForceOrBlockRecon(RF_Raid_t *raidPtr, RF_AccessStripeMap_t *asmap,
RF_RowCol_t fcol, diskno, i;
RF_ReconBuffer_t *new_rbuf; /* ptr to newly allocated rbufs */
RF_DiskQueueData_t *req;/* disk I/O req to be enqueued */
RF_CallbackDesc_t *cb;
RF_CallbackFuncDesc_t *cb;
int nPromoted;
psid = rf_MapStripeIDToParityStripeID(&raidPtr->Layout, stripeID, &which_ru);
@ -1821,7 +1820,9 @@ rf_ForceOrBlockRecon(RF_Raid_t *raidPtr, RF_AccessStripeMap_t *asmap,
/* use NULL b_proc b/c all addrs
* should be in kernel space */
req = rf_CreateDiskQueueData(RF_IO_TYPE_READ, offset + which_ru * sectorsPerRU, sectorsPerRU, new_rbuf->buffer,
psid, which_ru, (int (*) (void *, int)) ForceReconReadDoneProc, (void *) new_rbuf,
psid, which_ru,
ForceReconReadDoneProc,
(void *) new_rbuf,
NULL, (void *) raidPtr, 0, NULL, PR_WAITOK);
new_rbuf->arg = req;
@ -1838,11 +1839,9 @@ rf_ForceOrBlockRecon(RF_Raid_t *raidPtr, RF_AccessStripeMap_t *asmap,
}
/* install a callback descriptor to be invoked when recon completes on
* this parity stripe. */
cb = rf_AllocCallbackDesc();
/* XXX the following is bogus.. These functions don't really match!!
* GO */
cb->callbackFunc = (void (*) (RF_CBParam_t)) cbFunc;
cb->callbackArg.p = (void *) cbArg;
cb = rf_AllocCallbackFuncDesc();
cb->callbackFunc = cbFunc;
cb->callbackArg = cbArg;
cb->next = pssPtr->procWaitList;
pssPtr->procWaitList = cb;
DDprintf2("raid%d: Waiting for forced recon on psid %ld\n",
@ -1882,7 +1881,7 @@ rf_UnblockRecon(RF_Raid_t *raidPtr, RF_AccessStripeMap_t *asmap)
RF_ReconParityStripeStatus_t *pssPtr;
RF_ReconUnitNum_t which_ru;
RF_StripeNum_t psid;
RF_CallbackDesc_t *cb;
RF_CallbackValueDesc_t *cb;
psid = rf_MapStripeIDToParityStripeID(&raidPtr->Layout, stripeID, &which_ru);
RF_LOCK_PSS_MUTEX(raidPtr, psid);
@ -1919,7 +1918,7 @@ rf_UnblockRecon(RF_Raid_t *raidPtr, RF_AccessStripeMap_t *asmap)
pssPtr->blockWaitList = cb->next;
cb->next = NULL;
rf_CauseReconEvent(raidPtr, cb->col, NULL, RF_REVENT_BLOCKCLEAR);
rf_FreeCallbackDesc(cb);
rf_FreeCallbackValueDesc(cb);
}
if (!(pssPtr->flags & RF_PSS_UNDER_RECON)) {
/* if no recon was requested while recon was blocked */
@ -1934,7 +1933,7 @@ out:
void
rf_WakeupHeadSepCBWaiters(RF_Raid_t *raidPtr)
{
RF_CallbackDesc_t *p;
RF_CallbackValueDesc_t *p;
rf_lock_mutex2(raidPtr->reconControl->rb_mutex);
while(raidPtr->reconControl->rb_lock) {
@ -1950,7 +1949,7 @@ rf_WakeupHeadSepCBWaiters(RF_Raid_t *raidPtr)
raidPtr->reconControl->headSepCBList = p->next;
p->next = NULL;
rf_CauseReconEvent(raidPtr, p->col, NULL, RF_REVENT_HEADSEPCLEAR);
rf_FreeCallbackDesc(p);
rf_FreeCallbackValueDesc(p);
}
rf_lock_mutex2(raidPtr->reconControl->rb_mutex);
raidPtr->reconControl->rb_lock = 0;

View File

@ -1,4 +1,4 @@
/* $NetBSD: rf_reconstruct.h,v 1.28 2011/05/02 07:29:18 mrg Exp $ */
/* $NetBSD: rf_reconstruct.h,v 1.29 2019/10/10 03:43:59 christos Exp $ */
/*
* Copyright (c) 1995 Carnegie-Mellon University.
* All rights reserved.
@ -156,7 +156,7 @@ struct RF_ReconCtrl_s {
* waiting disk */
RF_ReconBuffer_t *fullBufferList; /* full buffers waiting to be
* written out */
RF_CallbackDesc_t *bufferWaitList; /* disks that are currently
RF_CallbackValueDesc_t *bufferWaitList; /* disks that are currently
* blocked waiting for buffers */
/* parity stripe status table */
@ -166,7 +166,7 @@ struct RF_ReconCtrl_s {
/* maximum-head separation control */
RF_HeadSepLimit_t minHeadSepCounter; /* the minimum hs counter over
* all disks */
RF_CallbackDesc_t *headSepCBList; /* list of callbacks to be
RF_CallbackValueDesc_t *headSepCBList; /* list of callbacks to be
* done as minPSID advances */
/* performance monitoring */
@ -181,8 +181,7 @@ int rf_ReconstructFailedDiskBasic(RF_Raid_t *, RF_RowCol_t);
int rf_ReconstructInPlace(RF_Raid_t *, RF_RowCol_t);
int rf_ContinueReconstructFailedDisk(RF_RaidReconDesc_t *);
int rf_ForceOrBlockRecon(RF_Raid_t *, RF_AccessStripeMap_t *,
void (*cbFunc) (RF_Raid_t *, void *),
void *);
void (*cbFunc) (void *), void *);
int rf_UnblockRecon(RF_Raid_t *, RF_AccessStripeMap_t *);
void rf_WakeupHeadSepCBWaiters(RF_Raid_t *);

View File

@ -1,4 +1,4 @@
/* $NetBSD: rf_states.c,v 1.50 2016/01/03 08:17:24 mlelstv Exp $ */
/* $NetBSD: rf_states.c,v 1.51 2019/10/10 03:43:59 christos 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.50 2016/01/03 08:17:24 mlelstv Exp $");
__KERNEL_RCSID(0, "$NetBSD: rf_states.c,v 1.51 2019/10/10 03:43:59 christos Exp $");
#include <sys/errno.h>
@ -94,8 +94,9 @@ StateName(RF_AccessState_t state)
#endif
void
rf_ContinueRaidAccess(RF_RaidAccessDesc_t *desc)
rf_ContinueRaidAccess(void *v)
{
RF_RaidAccessDesc_t *desc = v;
int suspended = RF_FALSE;
int current_state_index = desc->state;
RF_AccessState_t current_state = desc->states[current_state_index];
@ -211,10 +212,8 @@ rf_ContinueDagAccess(RF_DagList_t *dagList)
int
rf_State_LastState(RF_RaidAccessDesc_t *desc)
{
void (*callbackFunc) (RF_CBParam_t) = desc->callbackFunc;
RF_CBParam_t callbackArg;
callbackArg.p = desc->callbackArg;
void (*callbackFunc) (void *) = desc->callbackFunc;
void * callbackArg = desc->callbackArg;
/*
* We don't support non-async IO.
@ -281,7 +280,7 @@ rf_State_Quiesce(RF_RaidAccessDesc_t *desc)
RF_AccTraceEntry_t *tracerec = &desc->tracerec;
RF_Etimer_t timer;
#endif
RF_CallbackDesc_t *cb;
RF_CallbackFuncDesc_t *cb;
RF_Raid_t *raidPtr;
int suspended = RF_FALSE;
int need_cb, used_cb;
@ -307,13 +306,13 @@ rf_State_Quiesce(RF_RaidAccessDesc_t *desc)
if (need_cb) {
/* create a callback if we might need it...
and we likely do. */
cb = rf_AllocCallbackDesc();
cb = rf_AllocCallbackFuncDesc();
}
rf_lock_mutex2(raidPtr->access_suspend_mutex);
if (raidPtr->accesses_suspended) {
cb->callbackFunc = (void (*) (RF_CBParam_t)) rf_ContinueRaidAccess;
cb->callbackArg.p = (void *) desc;
cb->callbackFunc = rf_ContinueRaidAccess;
cb->callbackArg = desc;
cb->next = raidPtr->quiesce_wait_list;
raidPtr->quiesce_wait_list = cb;
suspended = RF_TRUE;
@ -322,7 +321,7 @@ rf_State_Quiesce(RF_RaidAccessDesc_t *desc)
rf_unlock_mutex2(raidPtr->access_suspend_mutex);
if ((need_cb == 1) && (used_cb == 0)) {
rf_FreeCallbackDesc(cb);
rf_FreeCallbackFuncDesc(cb);
}
#if RF_ACC_TRACE > 0
@ -394,7 +393,7 @@ rf_State_Lock(RF_RaidAccessDesc_t *desc)
lastStripeID = asm_p->stripeID;
RF_INIT_LOCK_REQ_DESC(asm_p->lockReqDesc, desc->type,
(void (*) (struct buf *)) rf_ContinueRaidAccess, desc, asm_p,
rf_ContinueRaidAccess, desc, asm_p,
raidPtr->Layout.dataSectorsPerStripe);
if (rf_AcquireStripeLock(raidPtr->lockTable, asm_p->stripeID,
&asm_p->lockReqDesc)) {
@ -409,7 +408,7 @@ rf_State_Lock(RF_RaidAccessDesc_t *desc)
asm_p->flags |= RF_ASM_FLAGS_FORCE_TRIED;
val = rf_ForceOrBlockRecon(raidPtr, asm_p,
(void (*) (RF_Raid_t *, void *)) rf_ContinueRaidAccess, desc);
rf_ContinueRaidAccess, desc);
if (val == 0) {
asm_p->flags |= RF_ASM_FLAGS_RECON_BLOCKED;
} else {

View File

@ -1,4 +1,4 @@
/* $NetBSD: rf_states.h,v 1.4 2001/10/04 15:58:56 oster Exp $ */
/* $NetBSD: rf_states.h,v 1.5 2019/10/10 03:43:59 christos Exp $ */
/*
* Copyright (c) 1995 Carnegie-Mellon University.
* All rights reserved.
@ -31,7 +31,7 @@
#include <dev/raidframe/raidframevar.h>
void rf_ContinueRaidAccess(RF_RaidAccessDesc_t * desc);
void rf_ContinueRaidAccess(void *);
void rf_ContinueDagAccess(RF_DagList_t * dagList);
int rf_State_LastState(RF_RaidAccessDesc_t * desc);
int rf_State_IncrAccessCount(RF_RaidAccessDesc_t * desc);

View File

@ -1,4 +1,4 @@
/* $NetBSD: rf_stripelocks.h,v 1.8 2011/05/05 08:21:29 mrg Exp $ */
/* $NetBSD: rf_stripelocks.h,v 1.9 2019/10/10 03:43:59 christos Exp $ */
/*
* Copyright (c) 1995 Carnegie-Mellon University.
* All rights reserved.
@ -54,7 +54,7 @@ struct RF_LockReqDesc_s {
RF_IoType_t type; /* read or write */
RF_int64 start, stop; /* start and end of range to be locked */
RF_int64 start2, stop2; /* start and end of 2nd range to be locked */
void (*cbFunc) (struct buf *); /* callback function */
void (*cbFunc) (void *); /* callback function */
void *cbArg; /* argument to callback function */
RF_LockReqDesc_t *next; /* next element in chain */
RF_LockReqDesc_t *templink; /* for making short-lived lists of