Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/dev/raidframe Having moved some of the bits needed by ra...
details: https://anonhg.NetBSD.org/src/rev/6369cb17728a
branches: trunk
changeset: 502959:6369cb17728a
user: oster <oster%NetBSD.org@localhost>
date: Sat Jan 27 19:34:43 2001 +0000
description:
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.
diffstat:
sys/dev/raidframe/rf_layout.c | 78 ++++++++++--------------------------------
1 files changed, 19 insertions(+), 59 deletions(-)
diffs (205 lines):
diff -r 0ed3d748075e -r 6369cb17728a sys/dev/raidframe/rf_layout.c
--- a/sys/dev/raidframe/rf_layout.c Sat Jan 27 19:32:47 2001 +0000
+++ b/sys/dev/raidframe/rf_layout.c Sat Jan 27 19:34:43 2001 +0000
@@ -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
+#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
-#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 @@
#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 @@
#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 @@
#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 @@
#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 @@
#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 @@
#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 @@
#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 @@
#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 @@
#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 @@
#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 @@
#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 @@
#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 @@
/* end-of-list marker */
{'\0', NULL,
- RF_NK2(NULL, NULL)
RF_NU(
NULL,
NULL, NULL, NULL,
@@ -423,16 +384,16 @@
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 @@
}
return (parityStripeID);
}
-#endif /* RF_UTILITY == 0 */
Home |
Main Index |
Thread Index |
Old Index