Having moved some of the bits needed by raidctl into rf_configure.c, we

no longer need those bits here.  In particular, this file is now only
used in the kernel, and that allows us to clean up a lot of cruft.
This commit is contained in:
oster 2001-01-27 19:34:43 +00:00
parent 705631a231
commit 75ea8b428e

View File

@ -1,4 +1,4 @@
/* $NetBSD: rf_layout.c,v 1.8 2001/01/27 02:13:34 oster Exp $ */
/* $NetBSD: rf_layout.c,v 1.9 2001/01/27 19:34:43 oster Exp $ */
/*
* Copyright (c) 1995 Carnegie-Mellon University.
* All rights reserved.
@ -75,51 +75,25 @@
***********************************************************************/
static RF_AccessState_t DefaultStates[] = {rf_QuiesceState,
rf_IncrAccessesCountState, rf_MapState, rf_LockState, rf_CreateDAGState,
rf_ExecuteDAGState, rf_ProcessDAGState, rf_DecrAccessesCountState,
rf_CleanupState, rf_LastState};
#if defined(__NetBSD__) && !defined(_KERNEL)
/* XXX Gross hack to shutup gcc -- it complains that DefaultStates is not
used when compiling this in userland.. I hate to burst it's bubble, but
DefaultStates is used all over the place here in the initialization of
lots of data structures. GO */
RF_AccessState_t *NothingAtAll = DefaultStates;
#endif
rf_IncrAccessesCountState,
rf_MapState,
rf_LockState,
rf_CreateDAGState,
rf_ExecuteDAGState,
rf_ProcessDAGState,
rf_DecrAccessesCountState,
rf_CleanupState,
rf_LastState};
#if defined(__NetBSD__) && defined(_KERNEL)
/* XXX Remove static so GCC doesn't complain about these being unused! */
#if RF_INCLUDE_PARITY_DECLUSTERING_DS > 0
int distSpareYes = 1;
#endif
#if (RF_INCLUDE_PARITY_DECLUSTERING > 0) || (RF_INCLUDE_DECL_PQ > 0) || (RF_INCLUDE_EVENODD > 0)
int distSpareNo = 0;
#endif
#else
#if RF_INCLUDE_PARITY_DECLUSTERING_DS > 0
static int distSpareYes = 1;
#endif
#if (RF_INCLUDE_PARITY_DECLUSTERING > 0) || (RF_INCLUDE_DECL_PQ > 0) || (RF_INCLUDE_EVENODD > 0)
static int distSpareNo = 0;
#endif
#endif
#ifdef _KERNEL
#define RF_NK2(a,b)
#else /* _KERNEL */
#define RF_NK2(a,b) a,b,
#endif /* _KERNEL */
#if RF_UTILITY > 0
#define RF_NU(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p)
#else /* RF_UTILITY > 0 */
#define RF_NU(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p) a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p
#endif /* RF_UTILITY > 0 */
/* Note that if you add any new RAID types to this list, that you must
also update the mapsw[] table in the raidctl sources */
static RF_LayoutSW_t mapsw[] = {
#if RF_INCLUDE_PARITY_DECLUSTERING > 0
/* parity declustering */
{'T', "Parity declustering",
RF_NK2(rf_MakeLayoutSpecificDeclustered, &distSpareNo)
RF_NU(
rf_ConfigureDeclustered,
rf_MapSectorDeclustered, rf_MapParityDeclustered, NULL,
@ -140,7 +114,6 @@ static RF_LayoutSW_t mapsw[] = {
#if RF_INCLUDE_PARITY_DECLUSTERING_DS > 0
/* parity declustering with distributed sparing */
{'D', "Distributed sparing parity declustering",
RF_NK2(rf_MakeLayoutSpecificDeclustered, &distSpareYes)
RF_NU(
rf_ConfigureDeclusteredDS,
rf_MapSectorDeclustered, rf_MapParityDeclustered, NULL,
@ -161,7 +134,6 @@ static RF_LayoutSW_t mapsw[] = {
#if RF_INCLUDE_DECL_PQ > 0
/* declustered P+Q */
{'Q', "Declustered P+Q",
RF_NK2(rf_MakeLayoutSpecificDeclustered, &distSpareNo)
RF_NU(
rf_ConfigureDeclusteredPQ,
rf_MapSectorDeclusteredPQ, rf_MapParityDeclusteredPQ, rf_MapQDeclusteredPQ,
@ -182,7 +154,6 @@ static RF_LayoutSW_t mapsw[] = {
#if RF_INCLUDE_RAID5_RS > 0
/* RAID 5 with rotated sparing */
{'R', "RAID Level 5 rotated sparing",
RF_NK2(rf_MakeLayoutSpecificNULL, NULL)
RF_NU(
rf_ConfigureRAID5_RS,
rf_MapSectorRAID5_RS, rf_MapParityRAID5_RS, NULL,
@ -203,7 +174,6 @@ static RF_LayoutSW_t mapsw[] = {
#if RF_INCLUDE_CHAINDECLUSTER > 0
/* Chained Declustering */
{'C', "Chained Declustering",
RF_NK2(rf_MakeLayoutSpecificNULL, NULL)
RF_NU(
rf_ConfigureChainDecluster,
rf_MapSectorChainDecluster, rf_MapParityChainDecluster, NULL,
@ -224,7 +194,6 @@ static RF_LayoutSW_t mapsw[] = {
#if RF_INCLUDE_INTERDECLUSTER > 0
/* Interleaved Declustering */
{'I', "Interleaved Declustering",
RF_NK2(rf_MakeLayoutSpecificNULL, NULL)
RF_NU(
rf_ConfigureInterDecluster,
rf_MapSectorInterDecluster, rf_MapParityInterDecluster, NULL,
@ -245,7 +214,6 @@ static RF_LayoutSW_t mapsw[] = {
#if RF_INCLUDE_RAID0 > 0
/* RAID level 0 */
{'0', "RAID Level 0",
RF_NK2(rf_MakeLayoutSpecificNULL, NULL)
RF_NU(
rf_ConfigureRAID0,
rf_MapSectorRAID0, rf_MapParityRAID0, NULL,
@ -266,7 +234,6 @@ static RF_LayoutSW_t mapsw[] = {
#if RF_INCLUDE_RAID1 > 0
/* RAID level 1 */
{'1', "RAID Level 1",
RF_NK2(rf_MakeLayoutSpecificNULL, NULL)
RF_NU(
rf_ConfigureRAID1,
rf_MapSectorRAID1, rf_MapParityRAID1, NULL,
@ -287,7 +254,6 @@ static RF_LayoutSW_t mapsw[] = {
#if RF_INCLUDE_RAID4 > 0
/* RAID level 4 */
{'4', "RAID Level 4",
RF_NK2(rf_MakeLayoutSpecificNULL, NULL)
RF_NU(
rf_ConfigureRAID4,
rf_MapSectorRAID4, rf_MapParityRAID4, NULL,
@ -308,7 +274,6 @@ static RF_LayoutSW_t mapsw[] = {
#if RF_INCLUDE_RAID5 > 0
/* RAID level 5 */
{'5', "RAID Level 5",
RF_NK2(rf_MakeLayoutSpecificNULL, NULL)
RF_NU(
rf_ConfigureRAID5,
rf_MapSectorRAID5, rf_MapParityRAID5, NULL,
@ -329,7 +294,6 @@ static RF_LayoutSW_t mapsw[] = {
#if RF_INCLUDE_EVENODD > 0
/* Evenodd */
{'E', "EvenOdd",
RF_NK2(rf_MakeLayoutSpecificNULL, NULL)
RF_NU(
rf_ConfigureEvenOdd,
rf_MapSectorRAID5, rf_MapParityEvenOdd, rf_MapEEvenOdd,
@ -350,7 +314,6 @@ static RF_LayoutSW_t mapsw[] = {
#if RF_INCLUDE_EVENODD > 0
/* Declustered Evenodd */
{'e', "Declustered EvenOdd",
RF_NK2(rf_MakeLayoutSpecificDeclustered, &distSpareNo)
RF_NU(
rf_ConfigureDeclusteredPQ,
rf_MapSectorDeclusteredPQ, rf_MapParityDeclusteredPQ, rf_MapQDeclusteredPQ,
@ -371,7 +334,6 @@ static RF_LayoutSW_t mapsw[] = {
#if RF_INCLUDE_PARITYLOGGING > 0
/* parity logging */
{'L', "Parity logging",
RF_NK2(rf_MakeLayoutSpecificNULL, NULL)
RF_NU(
rf_ConfigureParityLogging,
rf_MapSectorParityLogging, rf_MapParityParityLogging, NULL,
@ -391,7 +353,6 @@ static RF_LayoutSW_t mapsw[] = {
/* end-of-list marker */
{'\0', NULL,
RF_NK2(NULL, NULL)
RF_NU(
NULL,
NULL, NULL, NULL,
@ -423,16 +384,16 @@ rf_GetLayout(RF_ParityConfig_t parityConfig)
RF_ASSERT(p->parityConfig == parityConfig);
return (p);
}
#if RF_UTILITY == 0
/*****************************************************************************************
/*****************************************************************************
*
* ConfigureLayout --
*
* read the configuration file and set up the RAID layout parameters. After reading
* common params, invokes the layout-specific configuration routine to finish
* the configuration.
* read the configuration file and set up the RAID layout parameters.
* After reading common params, invokes the layout-specific
* configuration routine to finish the configuration.
*
****************************************************************************************/
****************************************************************************/
int
rf_ConfigureLayout(
RF_ShutdownList_t ** listp,
@ -526,4 +487,3 @@ rf_MapStripeIDToParityStripeID(layoutPtr, stripeID, which_ru)
}
return (parityStripeID);
}
#endif /* RF_UTILITY == 0 */