diff options
author | Niklas Hallqvist <niklas@cvs.openbsd.org> | 1999-02-16 00:03:34 +0000 |
---|---|---|
committer | Niklas Hallqvist <niklas@cvs.openbsd.org> | 1999-02-16 00:03:34 +0000 |
commit | 086450a69044f3ede65845d9a616116db9a6d006 (patch) | |
tree | a91a7d8f967737b7eed23cb127849d08e3af4d63 /sys/dev/raidframe/rf_evenodd_dags.c | |
parent | 41fb84abc5659cc1a368cd59d7929ddf756c3297 (diff) |
Merge from NetBSD, mostly indentation
Diffstat (limited to 'sys/dev/raidframe/rf_evenodd_dags.c')
-rw-r--r-- | sys/dev/raidframe/rf_evenodd_dags.c | 116 |
1 files changed, 53 insertions, 63 deletions
diff --git a/sys/dev/raidframe/rf_evenodd_dags.c b/sys/dev/raidframe/rf_evenodd_dags.c index 775fd5008f9..512b73b257c 100644 --- a/sys/dev/raidframe/rf_evenodd_dags.c +++ b/sys/dev/raidframe/rf_evenodd_dags.c @@ -1,5 +1,5 @@ -/* $OpenBSD: rf_evenodd_dags.c,v 1.1 1999/01/11 14:29:22 niklas Exp $ */ -/* $NetBSD: rf_evenodd_dags.c,v 1.1 1998/11/13 04:20:29 oster Exp $ */ +/* $OpenBSD: rf_evenodd_dags.c,v 1.2 1999/02/16 00:02:45 niklas Exp $ */ +/* $NetBSD: rf_evenodd_dags.c,v 1.2 1999/02/05 00:06:11 oster Exp $ */ /* * rf_evenodd_dags.c */ @@ -57,18 +57,16 @@ */ RF_CREATE_DAG_FUNC_DECL(rf_EO_100_CreateReadDAG) { - rf_CreateDegradedReadDAG(raidPtr, asmap, dag_h, bp, flags, allocList, &rf_eoPRecoveryFuncs); + rf_CreateDegradedReadDAG(raidPtr, asmap, dag_h, bp, flags, allocList, &rf_eoPRecoveryFuncs); } - /* * Lost data + E. * Use P to reconstruct missing data. */ RF_CREATE_DAG_FUNC_DECL(rf_EO_101_CreateReadDAG) { - rf_CreateDegradedReadDAG(raidPtr, asmap, dag_h, bp, flags, allocList, &rf_eoPRecoveryFuncs); + rf_CreateDegradedReadDAG(raidPtr, asmap, dag_h, bp, flags, allocList, &rf_eoPRecoveryFuncs); } - /* * Lost data + P. * Make E look like P, and use Eor for Xor, and we can @@ -76,124 +74,116 @@ RF_CREATE_DAG_FUNC_DECL(rf_EO_101_CreateReadDAG) */ RF_CREATE_DAG_FUNC_DECL(rf_EO_110_CreateReadDAG) { - RF_PhysDiskAddr_t *temp; - /* swap P and E pointers to fake out the DegradedReadDAG code */ - temp = asmap->parityInfo; asmap->parityInfo = asmap->qInfo; asmap->qInfo = temp; - rf_CreateDegradedReadDAG(raidPtr, asmap, dag_h, bp, flags, allocList, &rf_eoERecoveryFuncs); + RF_PhysDiskAddr_t *temp; + /* swap P and E pointers to fake out the DegradedReadDAG code */ + temp = asmap->parityInfo; + asmap->parityInfo = asmap->qInfo; + asmap->qInfo = temp; + rf_CreateDegradedReadDAG(raidPtr, asmap, dag_h, bp, flags, allocList, &rf_eoERecoveryFuncs); } - /* * Lost two data. */ RF_CREATE_DAG_FUNC_DECL(rf_EOCreateDoubleDegradedReadDAG) { - rf_EO_DoubleDegRead(raidPtr, asmap, dag_h, bp, flags, allocList); + rf_EO_DoubleDegRead(raidPtr, asmap, dag_h, bp, flags, allocList); } - /* * Lost two data. */ RF_CREATE_DAG_FUNC_DECL(rf_EO_200_CreateReadDAG) { - rf_EOCreateDoubleDegradedReadDAG(raidPtr, asmap, dag_h, bp, flags, allocList); + rf_EOCreateDoubleDegradedReadDAG(raidPtr, asmap, dag_h, bp, flags, allocList); } - 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); + 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); } - /* * E is dead. Small write. */ RF_CREATE_DAG_FUNC_DECL(rf_EO_001_CreateSmallWriteDAG) { - rf_CommonCreateSmallWriteDAG(raidPtr, asmap, dag_h, bp, flags, allocList, &rf_EOSmallWritePFuncs, NULL); + rf_CommonCreateSmallWriteDAG(raidPtr, asmap, dag_h, bp, flags, allocList, &rf_EOSmallWritePFuncs, NULL); } - /* * E is dead. Large write. */ RF_CREATE_DAG_FUNC_DECL(rf_EO_001_CreateLargeWriteDAG) { - rf_CommonCreateLargeWriteDAG(raidPtr, asmap, dag_h, bp, flags, allocList, 1, rf_RegularPFunc, RF_TRUE); + rf_CommonCreateLargeWriteDAG(raidPtr, asmap, dag_h, bp, flags, allocList, 1, rf_RegularPFunc, RF_TRUE); } - /* * P is dead. Small write. * Swap E + P, use single-degraded stuff. */ RF_CREATE_DAG_FUNC_DECL(rf_EO_010_CreateSmallWriteDAG) { - RF_PhysDiskAddr_t *temp; - /* swap P and E pointers to fake out the DegradedReadDAG code */ - temp = asmap->parityInfo; asmap->parityInfo = asmap->qInfo; asmap->qInfo = temp; - rf_CommonCreateSmallWriteDAG(raidPtr, asmap, dag_h, bp, flags, allocList, &rf_EOSmallWriteEFuncs, NULL); + RF_PhysDiskAddr_t *temp; + /* swap P and E pointers to fake out the DegradedReadDAG code */ + temp = asmap->parityInfo; + asmap->parityInfo = asmap->qInfo; + asmap->qInfo = temp; + rf_CommonCreateSmallWriteDAG(raidPtr, asmap, dag_h, bp, flags, allocList, &rf_EOSmallWriteEFuncs, NULL); } - /* * P is dead. Large write. * Swap E + P, use single-degraded stuff. */ RF_CREATE_DAG_FUNC_DECL(rf_EO_010_CreateLargeWriteDAG) { - RF_PhysDiskAddr_t *temp; - /* swap P and E pointers to fake out the code */ - temp = asmap->parityInfo; asmap->parityInfo = asmap->qInfo; asmap->qInfo = temp; - rf_CommonCreateLargeWriteDAG(raidPtr, asmap, dag_h, bp, flags, allocList, 1, rf_RegularEFunc, RF_FALSE); + RF_PhysDiskAddr_t *temp; + /* swap P and E pointers to fake out the code */ + temp = asmap->parityInfo; + asmap->parityInfo = asmap->qInfo; + asmap->qInfo = temp; + rf_CommonCreateLargeWriteDAG(raidPtr, asmap, dag_h, bp, flags, allocList, 1, rf_RegularEFunc, RF_FALSE); } - RF_CREATE_DAG_FUNC_DECL(rf_EO_011_CreateWriteDAG) { - rf_CreateNonRedundantWriteDAG(raidPtr, asmap, dag_h, bp, flags, allocList, - RF_IO_TYPE_WRITE); + rf_CreateNonRedundantWriteDAG(raidPtr, asmap, dag_h, bp, flags, allocList, + RF_IO_TYPE_WRITE); } - RF_CREATE_DAG_FUNC_DECL(rf_EO_110_CreateWriteDAG) { - RF_PhysDiskAddr_t *temp; + RF_PhysDiskAddr_t *temp; - if (asmap->numStripeUnitsAccessed != 1 && - asmap->failedPDAs[0]->numSector != raidPtr->Layout.sectorsPerStripeUnit) - { - RF_PANIC(); - } - /* swap P and E to fake out parity code */ - 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); - /* is the regular E func the right one to call? */ + if (asmap->numStripeUnitsAccessed != 1 && + asmap->failedPDAs[0]->numSector != raidPtr->Layout.sectorsPerStripeUnit) { + RF_PANIC(); + } + /* swap P and E to fake out parity code */ + 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); + /* is the regular E func the right one to call? */ } - RF_CREATE_DAG_FUNC_DECL(rf_EO_101_CreateWriteDAG) { - if (asmap->numStripeUnitsAccessed != 1 && - asmap->failedPDAs[0]->numSector != raidPtr->Layout.sectorsPerStripeUnit) - RF_PANIC(); - rf_CommonCreateSimpleDegradedWriteDAG(raidPtr, asmap, dag_h, bp, flags, allocList,1, rf_RecoveryXorFunc, RF_TRUE); + if (asmap->numStripeUnitsAccessed != 1 && + asmap->failedPDAs[0]->numSector != raidPtr->Layout.sectorsPerStripeUnit) + RF_PANIC(); + rf_CommonCreateSimpleDegradedWriteDAG(raidPtr, asmap, dag_h, bp, flags, allocList, 1, rf_RecoveryXorFunc, RF_TRUE); } - RF_CREATE_DAG_FUNC_DECL(rf_EO_DoubleDegRead) { - rf_DoubleDegRead(raidPtr, asmap, dag_h, bp, flags, allocList, - "Re", "EvenOddRecovery", rf_EvenOddDoubleRecoveryFunc); + rf_DoubleDegRead(raidPtr, asmap, dag_h, bp, flags, allocList, + "Re", "EvenOddRecovery", rf_EvenOddDoubleRecoveryFunc); } - RF_CREATE_DAG_FUNC_DECL(rf_EOCreateSmallWriteDAG) { - rf_CommonCreateSmallWriteDAG(raidPtr, asmap, dag_h, bp, flags, allocList, &rf_pFuncs, &rf_EOSmallWriteEFuncs); + rf_CommonCreateSmallWriteDAG(raidPtr, asmap, dag_h, bp, flags, allocList, &rf_pFuncs, &rf_EOSmallWriteEFuncs); } - RF_CREATE_DAG_FUNC_DECL(rf_EOCreateLargeWriteDAG) { - rf_CommonCreateLargeWriteDAG(raidPtr, asmap, dag_h, bp, flags, allocList, 2, rf_RegularPEFunc, RF_FALSE); + rf_CommonCreateLargeWriteDAG(raidPtr, asmap, dag_h, bp, flags, allocList, 2, rf_RegularPEFunc, RF_FALSE); } - RF_CREATE_DAG_FUNC_DECL(rf_EO_200_CreateWriteDAG) { - rf_DoubleDegSmallWrite(raidPtr, asmap, dag_h, bp, flags, allocList, "Re", "We", "EOWrDDRecovery", rf_EOWriteDoubleRecoveryFunc); + rf_DoubleDegSmallWrite(raidPtr, asmap, dag_h, bp, flags, allocList, "Re", "We", "EOWrDDRecovery", rf_EOWriteDoubleRecoveryFunc); } - -#endif /* RF_INCLUDE_EVENODD > 0 */ +#endif /* RF_INCLUDE_EVENODD > 0 */ |