diff options
| author | oster <oster@NetBSD.org> | 2004-02-29 04:03:50 +0000 |
|---|---|---|
| committer | oster <oster@NetBSD.org> | 2004-02-29 04:03:50 +0000 |
| commit | 5a02af5b2137cc7b754a822f3138147472b8dc65 (patch) | |
| tree | 0805307e12eb721415c3729ecaacb94fed9a9656 /sys/dev/raidframe | |
| parent | da96c7f542cd08525a7f3e36990b82defa3fd1bd (diff) | |
Adjust _rf_ShutdownCreate() so that it is willing to wait for more
memory. Since we only now ever "return(0)", just return (void)
instead.
Cleanup all uses of rf_ShutdownCreate() to not worry about
it ever failing. Shaves another 600 bytes off of an i386 GENERIC kernel.
Diffstat (limited to 'sys/dev/raidframe')
| -rw-r--r-- | sys/dev/raidframe/rf_acctrace.h | 6 | ||||
| -rw-r--r-- | sys/dev/raidframe/rf_alloclist.c | 11 | ||||
| -rw-r--r-- | sys/dev/raidframe/rf_callback.c | 13 | ||||
| -rw-r--r-- | sys/dev/raidframe/rf_dagutils.c | 13 | ||||
| -rw-r--r-- | sys/dev/raidframe/rf_decluster.c | 12 | ||||
| -rw-r--r-- | sys/dev/raidframe/rf_diskqueue.c | 14 | ||||
| -rw-r--r-- | sys/dev/raidframe/rf_driver.c | 24 | ||||
| -rw-r--r-- | sys/dev/raidframe/rf_engine.c | 14 | ||||
| -rw-r--r-- | sys/dev/raidframe/rf_map.c | 13 | ||||
| -rw-r--r-- | sys/dev/raidframe/rf_mcpair.c | 12 | ||||
| -rw-r--r-- | sys/dev/raidframe/rf_nwayxor.c | 10 | ||||
| -rw-r--r-- | sys/dev/raidframe/rf_paritylogging.c | 66 | ||||
| -rw-r--r-- | sys/dev/raidframe/rf_psstatus.c | 13 | ||||
| -rw-r--r-- | sys/dev/raidframe/rf_reconstruct.c | 13 | ||||
| -rw-r--r-- | sys/dev/raidframe/rf_revent.c | 12 | ||||
| -rw-r--r-- | sys/dev/raidframe/rf_shutdown.c | 11 | ||||
| -rw-r--r-- | sys/dev/raidframe/rf_shutdown.h | 4 | ||||
| -rw-r--r-- | sys/dev/raidframe/rf_stripelocks.c | 21 |
18 files changed, 84 insertions, 198 deletions
diff --git a/sys/dev/raidframe/rf_acctrace.h b/sys/dev/raidframe/rf_acctrace.h index f5c3742be0a..8529690c0ae 100644 --- a/sys/dev/raidframe/rf_acctrace.h +++ b/sys/dev/raidframe/rf_acctrace.h @@ -1,4 +1,4 @@ -/* $NetBSD: rf_acctrace.h,v 1.6 2002/11/23 02:44:14 oster Exp $ */ +/* $NetBSD: rf_acctrace.h,v 1.7 2004/02/29 04:03:50 oster Exp $ */ /* * Copyright (c) 1995 Carnegie-Mellon University. * All rights reserved. @@ -126,7 +126,7 @@ typedef struct RF_AccTotals_s { RF_DECLARE_EXTERN_MUTEX(rf_tracing_mutex) - int rf_ConfigureAccessTrace(RF_ShutdownList_t ** listp); - void rf_LogTraceRec(RF_Raid_t * raid, RF_AccTraceEntry_t * rec); +int rf_ConfigureAccessTrace(RF_ShutdownList_t ** listp); +void rf_LogTraceRec(RF_Raid_t * raid, RF_AccTraceEntry_t * rec); #endif /* !_RF__RF_ACCTRACE_H_ */ diff --git a/sys/dev/raidframe/rf_alloclist.c b/sys/dev/raidframe/rf_alloclist.c index e82c8ac8d84..43e901bf646 100644 --- a/sys/dev/raidframe/rf_alloclist.c +++ b/sys/dev/raidframe/rf_alloclist.c @@ -1,4 +1,4 @@ -/* $NetBSD: rf_alloclist.c,v 1.17 2004/02/25 02:15:52 oster Exp $ */ +/* $NetBSD: rf_alloclist.c,v 1.18 2004/02/29 04:03:50 oster Exp $ */ /* * Copyright (c) 1995 Carnegie-Mellon University. * All rights reserved. @@ -37,7 +37,7 @@ ***************************************************************************/ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: rf_alloclist.c,v 1.17 2004/02/25 02:15:52 oster Exp $"); +__KERNEL_RCSID(0, "$NetBSD: rf_alloclist.c,v 1.18 2004/02/29 04:03:50 oster Exp $"); #include <dev/raidframe/raidframevar.h> @@ -64,18 +64,13 @@ static void rf_ShutdownAllocList(void *ignored) int rf_ConfigureAllocList(RF_ShutdownList_t **listp) { - int rc; pool_init(&rf_alloclist_pool, sizeof(RF_AllocListElem_t), 0, 0, 0, "rf_alloclist_pl", NULL); pool_sethiwat(&rf_alloclist_pool, RF_AL_FREELIST_MAX); pool_prime(&rf_alloclist_pool, 16); /* need something.. */ - rc = rf_ShutdownCreate(listp, rf_ShutdownAllocList, NULL); - if (rc) { - rf_print_unable_to_add_shutdown( __FILE__, __LINE__, rc); - return (rc); - } + rf_ShutdownCreate(listp, rf_ShutdownAllocList, NULL); return (0); } diff --git a/sys/dev/raidframe/rf_callback.c b/sys/dev/raidframe/rf_callback.c index 9c379d6e646..9c9ace5741a 100644 --- a/sys/dev/raidframe/rf_callback.c +++ b/sys/dev/raidframe/rf_callback.c @@ -1,4 +1,4 @@ -/* $NetBSD: rf_callback.c,v 1.12 2003/12/30 21:59:03 oster Exp $ */ +/* $NetBSD: rf_callback.c,v 1.13 2004/02/29 04:03:50 oster 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.12 2003/12/30 21:59:03 oster Exp $"); +__KERNEL_RCSID(0, "$NetBSD: rf_callback.c,v 1.13 2004/02/29 04:03:50 oster Exp $"); #include <dev/raidframe/raidframevar.h> #include <sys/pool.h> @@ -62,19 +62,14 @@ int rf_ConfigureCallback(listp) RF_ShutdownList_t **listp; { - int rc; pool_init(&rf_callback_pool, sizeof(RF_CallbackDesc_t), 0, 0, 0, "rf_callbackpl", NULL); pool_sethiwat(&rf_callback_pool, RF_MAX_FREE_CALLBACK); pool_prime(&rf_callback_pool, RF_CALLBACK_INITIAL); - rc = rf_ShutdownCreate(listp, rf_ShutdownCallback, NULL); - if (rc) { - rf_print_unable_to_add_shutdown(__FILE__,__LINE__, rc); - rf_ShutdownCallback(NULL); - return (rc); - } + rf_ShutdownCreate(listp, rf_ShutdownCallback, NULL); + return (0); } diff --git a/sys/dev/raidframe/rf_dagutils.c b/sys/dev/raidframe/rf_dagutils.c index 873af8c0ffd..f8c8af13d2b 100644 --- a/sys/dev/raidframe/rf_dagutils.c +++ b/sys/dev/raidframe/rf_dagutils.c @@ -1,4 +1,4 @@ -/* $NetBSD: rf_dagutils.c,v 1.28 2004/02/29 01:47:45 oster Exp $ */ +/* $NetBSD: rf_dagutils.c,v 1.29 2004/02/29 04:03:50 oster Exp $ */ /* * Copyright (c) 1995 Carnegie-Mellon University. * All rights reserved. @@ -33,7 +33,7 @@ *****************************************************************************/ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: rf_dagutils.c,v 1.28 2004/02/29 01:47:45 oster Exp $"); +__KERNEL_RCSID(0, "$NetBSD: rf_dagutils.c,v 1.29 2004/02/29 04:03:50 oster Exp $"); #include <dev/raidframe/raidframevar.h> @@ -192,7 +192,6 @@ rf_ShutdownDAGs(void *ignored) int rf_ConfigureDAGs(RF_ShutdownList_t **listp) { - int rc; pool_init(&rf_dagh_pool, sizeof(RF_DagHeader_t), 0, 0, 0, "rf_dagh_pl", NULL); @@ -209,12 +208,8 @@ rf_ConfigureDAGs(RF_ShutdownList_t **listp) pool_sethiwat(&rf_funclist_pool, RF_MAX_FREE_FUNCLIST); pool_prime(&rf_funclist_pool, RF_FUNCLIST_INITIAL); - rc = rf_ShutdownCreate(listp, rf_ShutdownDAGs, NULL); - if (rc) { - rf_print_unable_to_add_shutdown(__FILE__, __LINE__, rc); - rf_ShutdownDAGs(NULL); - return (rc); - } + rf_ShutdownCreate(listp, rf_ShutdownDAGs, NULL); + return (0); } diff --git a/sys/dev/raidframe/rf_decluster.c b/sys/dev/raidframe/rf_decluster.c index f6306ff3a8d..63ad061b44a 100644 --- a/sys/dev/raidframe/rf_decluster.c +++ b/sys/dev/raidframe/rf_decluster.c @@ -1,4 +1,4 @@ -/* $NetBSD: rf_decluster.c,v 1.15 2003/12/30 21:59:03 oster Exp $ */ +/* $NetBSD: rf_decluster.c,v 1.16 2004/02/29 04:03:50 oster Exp $ */ /* * Copyright (c) 1995 Carnegie-Mellon University. * All rights reserved. @@ -48,7 +48,7 @@ *--------------------------------------------------------------------*/ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: rf_decluster.c,v 1.15 2003/12/30 21:59:03 oster Exp $"); +__KERNEL_RCSID(0, "$NetBSD: rf_decluster.c,v 1.16 2004/02/29 04:03:50 oster Exp $"); #include <dev/raidframe/raidframevar.h> @@ -308,12 +308,8 @@ rf_ConfigureDeclusteredDS(RF_ShutdownList_t **listp, RF_Raid_t *raidPtr, rc = rf_ConfigureDeclustered(listp, raidPtr, cfgPtr); if (rc) return (rc); - rc = rf_ShutdownCreate(listp, rf_ShutdownDeclusteredDS, raidPtr); - if (rc) { - RF_ERRORMSG1("Got %d adding shutdown event for DeclusteredDS\n", rc); - rf_ShutdownDeclusteredDS(raidPtr); - return (rc); - } + rf_ShutdownCreate(listp, rf_ShutdownDeclusteredDS, raidPtr); + return (0); } diff --git a/sys/dev/raidframe/rf_diskqueue.c b/sys/dev/raidframe/rf_diskqueue.c index b4b3aef6c10..0ec366513c2 100644 --- a/sys/dev/raidframe/rf_diskqueue.c +++ b/sys/dev/raidframe/rf_diskqueue.c @@ -1,4 +1,4 @@ -/* $NetBSD: rf_diskqueue.c,v 1.29 2004/01/01 19:27:35 oster Exp $ */ +/* $NetBSD: rf_diskqueue.c,v 1.30 2004/02/29 04:03:50 oster Exp $ */ /* * Copyright (c) 1995 Carnegie-Mellon University. * All rights reserved. @@ -66,7 +66,7 @@ ****************************************************************************/ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: rf_diskqueue.c,v 1.29 2004/01/01 19:27:35 oster Exp $"); +__KERNEL_RCSID(0, "$NetBSD: rf_diskqueue.c,v 1.30 2004/02/29 04:03:50 oster Exp $"); #include <dev/raidframe/raidframevar.h> @@ -186,22 +186,16 @@ rf_ShutdownDiskQueueSystem(void *ignored) pool_destroy(&rf_dqd_pool); } -int +int rf_ConfigureDiskQueueSystem(RF_ShutdownList_t **listp) { - int rc; pool_init(&rf_dqd_pool, sizeof(RF_DiskQueueData_t), 0, 0, 0, "rf_dqd_pl", NULL); pool_sethiwat(&rf_dqd_pool, RF_MAX_FREE_DQD); pool_prime(&rf_dqd_pool, RF_DQD_INITIAL); - rc = rf_ShutdownCreate(listp, rf_ShutdownDiskQueueSystem, NULL); - if (rc) { - rf_print_unable_to_add_shutdown( __FILE__, __LINE__, rc); - rf_ShutdownDiskQueueSystem(NULL); - return (rc); - } + rf_ShutdownCreate(listp, rf_ShutdownDiskQueueSystem, NULL); return (0); } diff --git a/sys/dev/raidframe/rf_driver.c b/sys/dev/raidframe/rf_driver.c index 3b3f730b8b7..225dabcf7e8 100644 --- a/sys/dev/raidframe/rf_driver.c +++ b/sys/dev/raidframe/rf_driver.c @@ -1,4 +1,4 @@ -/* $NetBSD: rf_driver.c,v 1.85 2004/02/27 02:55:17 oster Exp $ */ +/* $NetBSD: rf_driver.c,v 1.86 2004/02/29 04:03:50 oster Exp $ */ /*- * Copyright (c) 1999 The NetBSD Foundation, Inc. * All rights reserved. @@ -73,7 +73,7 @@ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: rf_driver.c,v 1.85 2004/02/27 02:55:17 oster Exp $"); +__KERNEL_RCSID(0, "$NetBSD: rf_driver.c,v 1.86 2004/02/29 04:03:50 oster Exp $"); #include "opt_raid_diagnostic.h" @@ -330,14 +330,10 @@ rf_Configure(RF_Raid_t *raidPtr, RF_Config_t *cfgPtr, RF_AutoConfig_t *ac) DO_RAID_FAIL(); return (ENOMEM); } - rc = rf_ShutdownCreate(&raidPtr->shutdownList, - (void (*) (void *)) rf_FreeAllocList, - raidPtr->cleanupList); - if (rc) { - rf_print_unable_to_add_shutdown(__FILE__, __LINE__, rc); - DO_RAID_FAIL(); - return (rc); - } + rf_ShutdownCreate(&raidPtr->shutdownList, + (void (*) (void *)) rf_FreeAllocList, + raidPtr->cleanupList); + raidPtr->numCol = cfgPtr->numCol; raidPtr->numSpare = cfgPtr->numSpare; @@ -434,18 +430,12 @@ rf_ShutdownRDFreeList(void *ignored) static int rf_ConfigureRDFreeList(RF_ShutdownList_t **listp) { - int rc; pool_init(&rf_rad_pool, sizeof(RF_RaidAccessDesc_t), 0, 0, 0, "rf_rad_pl", NULL); pool_sethiwat(&rf_rad_pool, RF_MAX_FREE_RAD); pool_prime(&rf_rad_pool, RF_RAD_INITIAL); - rc = rf_ShutdownCreate(listp, rf_ShutdownRDFreeList, NULL); - if (rc) { - rf_print_unable_to_add_shutdown(__FILE__, __LINE__, rc); - rf_ShutdownRDFreeList(NULL); - return (rc); - } + rf_ShutdownCreate(listp, rf_ShutdownRDFreeList, NULL); simple_lock_init(&rf_rad_pool_lock); return (0); } diff --git a/sys/dev/raidframe/rf_engine.c b/sys/dev/raidframe/rf_engine.c index 619981e6162..30176df229a 100644 --- a/sys/dev/raidframe/rf_engine.c +++ b/sys/dev/raidframe/rf_engine.c @@ -1,4 +1,4 @@ -/* $NetBSD: rf_engine.c,v 1.31 2004/01/02 21:41:08 oster Exp $ */ +/* $NetBSD: rf_engine.c,v 1.32 2004/02/29 04:03:50 oster Exp $ */ /* * Copyright (c) 1995 Carnegie-Mellon University. * All rights reserved. @@ -55,7 +55,7 @@ ****************************************************************************/ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: rf_engine.c,v 1.31 2004/01/02 21:41:08 oster Exp $"); +__KERNEL_RCSID(0, "$NetBSD: rf_engine.c,v 1.32 2004/02/29 04:03:50 oster Exp $"); #include <sys/errno.h> @@ -125,7 +125,6 @@ int rf_ConfigureEngine(RF_ShutdownList_t **listp, RF_Raid_t *raidPtr, RF_Config_t *cfgPtr) { - int rc; rf_mutex_init(&raidPtr->node_queue_mutex); raidPtr->node_queue = NULL; @@ -159,12 +158,9 @@ rf_ConfigureEngine(RF_ShutdownList_t **listp, RF_Raid_t *raidPtr, if (rf_engineDebug) { printf("raid%d: Engine thread running and waiting for events\n", raidPtr->raidid); } - rc = rf_ShutdownCreate(listp, rf_ShutdownEngine, raidPtr); - if (rc) { - rf_print_unable_to_add_shutdown(__FILE__, __LINE__, rc); - rf_ShutdownEngine(NULL); - } - return (rc); + rf_ShutdownCreate(listp, rf_ShutdownEngine, raidPtr); + + return (0); } static int diff --git a/sys/dev/raidframe/rf_map.c b/sys/dev/raidframe/rf_map.c index d3c8f8958ac..74577836bc2 100644 --- a/sys/dev/raidframe/rf_map.c +++ b/sys/dev/raidframe/rf_map.c @@ -1,4 +1,4 @@ -/* $NetBSD: rf_map.c,v 1.28 2003/12/30 22:12:10 oster Exp $ */ +/* $NetBSD: rf_map.c,v 1.29 2004/02/29 04:03:50 oster Exp $ */ /* * Copyright (c) 1995 Carnegie-Mellon University. * All rights reserved. @@ -33,7 +33,7 @@ **************************************************************************/ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: rf_map.c,v 1.28 2003/12/30 22:12:10 oster Exp $"); +__KERNEL_RCSID(0, "$NetBSD: rf_map.c,v 1.29 2004/02/29 04:03:50 oster Exp $"); #include <dev/raidframe/raidframevar.h> @@ -341,7 +341,6 @@ rf_ShutdownMapModule(void *ignored) int rf_ConfigureMapModule(RF_ShutdownList_t **listp) { - int rc; pool_init(&rf_asmhdr_pool, sizeof(RF_AccessStripeMapHeader_t), 0, 0, 0, "rf_asmhdr_pl", NULL); @@ -358,12 +357,8 @@ rf_ConfigureMapModule(RF_ShutdownList_t **listp) pool_sethiwat(&rf_pda_pool, RF_MAX_FREE_PDA); pool_prime(&rf_pda_pool, RF_PDA_INITIAL); - rc = rf_ShutdownCreate(listp, rf_ShutdownMapModule, NULL); - if (rc) { - rf_print_unable_to_add_shutdown(__FILE__, __LINE__, rc); - rf_ShutdownMapModule(NULL); - return (rc); - } + rf_ShutdownCreate(listp, rf_ShutdownMapModule, NULL); + return (0); } diff --git a/sys/dev/raidframe/rf_mcpair.c b/sys/dev/raidframe/rf_mcpair.c index 3b15ecaf7ed..852ee434e95 100644 --- a/sys/dev/raidframe/rf_mcpair.c +++ b/sys/dev/raidframe/rf_mcpair.c @@ -1,4 +1,4 @@ -/* $NetBSD: rf_mcpair.c,v 1.12 2003/12/30 21:59:03 oster Exp $ */ +/* $NetBSD: rf_mcpair.c,v 1.13 2004/02/29 04:03:50 oster Exp $ */ /* * Copyright (c) 1995 Carnegie-Mellon University. * All rights reserved. @@ -32,7 +32,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: rf_mcpair.c,v 1.12 2003/12/30 21:59:03 oster Exp $"); +__KERNEL_RCSID(0, "$NetBSD: rf_mcpair.c,v 1.13 2004/02/29 04:03:50 oster Exp $"); #include <dev/raidframe/raidframevar.h> @@ -62,19 +62,13 @@ rf_ShutdownMCPair(void *ignored) int rf_ConfigureMCPair(RF_ShutdownList_t **listp) { - int rc; pool_init(&rf_mcpair_pool, sizeof(RF_MCPair_t), 0, 0, 0, "rf_mcpair_pl", NULL); pool_sethiwat(&rf_mcpair_pool, RF_MAX_FREE_MCPAIR); pool_prime(&rf_mcpair_pool, RF_MCPAIR_INITIAL); - rc = rf_ShutdownCreate(listp, rf_ShutdownMCPair, NULL); - if (rc) { - rf_print_unable_to_add_shutdown(__FILE__, __LINE__, rc); - rf_ShutdownMCPair(NULL); - return (rc); - } + rf_ShutdownCreate(listp, rf_ShutdownMCPair, NULL); return (0); } diff --git a/sys/dev/raidframe/rf_nwayxor.c b/sys/dev/raidframe/rf_nwayxor.c index 2fba7ffb43b..b172917768a 100644 --- a/sys/dev/raidframe/rf_nwayxor.c +++ b/sys/dev/raidframe/rf_nwayxor.c @@ -1,4 +1,4 @@ -/* $NetBSD: rf_nwayxor.c,v 1.6 2003/12/30 21:59:03 oster Exp $ */ +/* $NetBSD: rf_nwayxor.c,v 1.7 2004/02/29 04:03:50 oster Exp $ */ /* * Copyright (c) 1995 Carnegie-Mellon University. * All rights reserved. @@ -36,7 +36,7 @@ ************************************************************/ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: rf_nwayxor.c,v 1.6 2003/12/30 21:59:03 oster Exp $"); +__KERNEL_RCSID(0, "$NetBSD: rf_nwayxor.c,v 1.7 2004/02/29 04:03:50 oster Exp $"); #include "rf_nwayxor.h" #include "rf_shutdown.h" @@ -60,12 +60,12 @@ rf_ShutdownNWayXor(void *ignored) int rf_ConfigureNWayXor(RF_ShutdownList_t **listp) { - int i, rc; + int i; for (i = 0; i < 10; i++) callcount[i] = 0; - rc = rf_ShutdownCreate(listp, rf_ShutdownNWayXor, NULL); - return (rc); + rf_ShutdownCreate(listp, rf_ShutdownNWayXor, NULL); + return (0); } void diff --git a/sys/dev/raidframe/rf_paritylogging.c b/sys/dev/raidframe/rf_paritylogging.c index 57a0d6630a6..4652e26bf00 100644 --- a/sys/dev/raidframe/rf_paritylogging.c +++ b/sys/dev/raidframe/rf_paritylogging.c @@ -1,4 +1,4 @@ -/* $NetBSD: rf_paritylogging.c,v 1.21 2003/12/29 05:48:13 oster Exp $ */ +/* $NetBSD: rf_paritylogging.c,v 1.22 2004/02/29 04:03:50 oster Exp $ */ /* * Copyright (c) 1995 Carnegie-Mellon University. * All rights reserved. @@ -32,7 +32,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: rf_paritylogging.c,v 1.21 2003/12/29 05:48:13 oster Exp $"); +__KERNEL_RCSID(0, "$NetBSD: rf_paritylogging.c,v 1.22 2004/02/29 04:03:50 oster Exp $"); #include "rf_archs.h" @@ -297,13 +297,7 @@ rf_ConfigureParityLogging( return (ENOMEM); } } - rc = rf_ShutdownCreate(listp, rf_ShutdownParityLoggingPool, raidPtr); - if (rc) { - RF_ERRORMSG3("Unable to create shutdown entry file %s line %d rc=%d\n", __FILE__, - __LINE__, rc); - rf_ShutdownParityLoggingPool(raidPtr); - return (rc); - } + rf_ShutdownCreate(listp, rf_ShutdownParityLoggingPool, raidPtr); /* build pool of region buffers */ rc = rf_mutex_init(&raidPtr->regionBufferPool.mutex); if (rc) { @@ -353,15 +347,9 @@ rf_ConfigureParityLogging( printf("raidPtr->regionBufferPool.buffers[%d] = %lx\n", i, (long) raidPtr->regionBufferPool.buffers[i]); } - rc = rf_ShutdownCreate(listp, - rf_ShutdownParityLoggingRegionBufferPool, - raidPtr); - if (rc) { - RF_ERRORMSG3("Unable to create shutdown entry file %s line %d rc=%d\n", __FILE__, - __LINE__, rc); - rf_ShutdownParityLoggingRegionBufferPool(raidPtr); - return (rc); - } + rf_ShutdownCreate(listp, + rf_ShutdownParityLoggingRegionBufferPool, + raidPtr); /* build pool of parity buffers */ parityBufferCapacity = maxRegionParityRange; rc = rf_mutex_init(&raidPtr->parityBufferPool.mutex); @@ -413,15 +401,9 @@ rf_ConfigureParityLogging( printf("parityBufferPool.buffers[%d] = %lx\n", i, (long) raidPtr->parityBufferPool.buffers[i]); } - rc = rf_ShutdownCreate(listp, - rf_ShutdownParityLoggingParityBufferPool, - raidPtr); - if (rc) { - RF_ERRORMSG3("Unable to create shutdown entry file %s line %d rc=%d\n", __FILE__, - __LINE__, rc); - rf_ShutdownParityLoggingParityBufferPool(raidPtr); - return (rc); - } + rf_ShutdownCreate(listp, + rf_ShutdownParityLoggingParityBufferPool, + raidPtr); /* initialize parityLogDiskQueue */ rf_mutex_init(&raidPtr->parityLogDiskQueue.mutex); raidPtr->parityLogDiskQueue.cond = 0; @@ -438,14 +420,9 @@ rf_ConfigureParityLogging( raidPtr->parityLogDiskQueue.freeDataList = NULL; raidPtr->parityLogDiskQueue.freeCommonList = NULL; - rc = rf_ShutdownCreate(listp, - rf_ShutdownParityLoggingDiskQueue, - raidPtr); - if (rc) { - RF_ERRORMSG3("Unable to create shutdown entry file %s line %d rc=%d\n", __FILE__, - __LINE__, rc); - return (rc); - } + rf_ShutdownCreate(listp, + rf_ShutdownParityLoggingDiskQueue, + raidPtr); for (i = 0; i < rf_numParityRegions; i++) { rc = rf_mutex_init(&raidPtr->regionInfo[i].mutex); if (rc) { @@ -513,15 +490,9 @@ rf_ConfigureParityLogging( raidPtr->regionInfo[i].loggingEnabled = RF_FALSE; raidPtr->regionInfo[i].coreLog = NULL; } - rc = rf_ShutdownCreate(listp, - rf_ShutdownParityLoggingRegionInfo, - raidPtr); - if (rc) { - RF_ERRORMSG3("Unable to create shutdown entry file %s line %d rc=%d\n", __FILE__, - __LINE__, rc); - rf_ShutdownParityLoggingRegionInfo(raidPtr); - return (rc); - } + rf_ShutdownCreate(listp, + rf_ShutdownParityLoggingRegionInfo, + raidPtr); RF_ASSERT(raidPtr->parityLogDiskQueue.threadState == 0); raidPtr->parityLogDiskQueue.threadState = RF_PLOG_CREATED; rc = RF_CREATE_THREAD(raidPtr->pLogDiskThreadHandle, @@ -540,12 +511,7 @@ rf_ConfigureParityLogging( } RF_UNLOCK_MUTEX(raidPtr->parityLogDiskQueue.mutex); - rc = rf_ShutdownCreate(listp, rf_ShutdownParityLogging, raidPtr); - if (rc) { - RF_ERRORMSG1("Got rc=%d adding parity logging shutdown event\n", rc); - rf_ShutdownParityLogging(raidPtr); - return (rc); - } + rf_ShutdownCreate(listp, rf_ShutdownParityLogging, raidPtr); if (rf_parityLogDebug) { printf(" size of disk log in sectors: %d\n", (int) totalLogCapacity); diff --git a/sys/dev/raidframe/rf_psstatus.c b/sys/dev/raidframe/rf_psstatus.c index 70ddf0bd990..61f09ee4b20 100644 --- a/sys/dev/raidframe/rf_psstatus.c +++ b/sys/dev/raidframe/rf_psstatus.c @@ -1,4 +1,4 @@ -/* $NetBSD: rf_psstatus.c,v 1.20 2003/12/31 00:42:46 oster Exp $ */ +/* $NetBSD: rf_psstatus.c,v 1.21 2004/02/29 04:03:50 oster Exp $ */ /* * Copyright (c) 1995 Carnegie-Mellon University. * All rights reserved. @@ -37,7 +37,7 @@ *****************************************************************************/ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: rf_psstatus.c,v 1.20 2003/12/31 00:42:46 oster Exp $"); +__KERNEL_RCSID(0, "$NetBSD: rf_psstatus.c,v 1.21 2004/02/29 04:03:50 oster Exp $"); #include <dev/raidframe/raidframevar.h> @@ -80,7 +80,6 @@ int rf_ConfigurePSStatus(RF_ShutdownList_t **listp, RF_Raid_t *raidPtr, RF_Config_t *cfgPtr) { - int rc; raidPtr->pssTableSize = RF_PSS_DEFAULT_TABLESIZE; pool_init(&raidPtr->pss_pool, sizeof(RF_ReconParityStripeStatus_t), 0, @@ -88,12 +87,8 @@ rf_ConfigurePSStatus(RF_ShutdownList_t **listp, RF_Raid_t *raidPtr, pool_init(&raidPtr->pss_issued_pool, raidPtr->numCol * sizeof(char), 0, 0, 0, "raidpssissuedpl", NULL); - rc = rf_ShutdownCreate(listp, rf_ShutdownPSStatus, raidPtr); - if (rc) { - rf_print_unable_to_add_shutdown(__FILE__, __LINE__, rc); - rf_ShutdownPSStatus(raidPtr); - return (rc); - } + rf_ShutdownCreate(listp, rf_ShutdownPSStatus, raidPtr); + pool_sethiwat(&raidPtr->pss_pool, RF_MAX_FREE_PSS); pool_sethiwat(&raidPtr->pss_issued_pool, RF_MAX_FREE_PSS); pool_prime(&raidPtr->pss_pool, RF_PSS_INITIAL); diff --git a/sys/dev/raidframe/rf_reconstruct.c b/sys/dev/raidframe/rf_reconstruct.c index 789c3de0d01..0aba952b87e 100644 --- a/sys/dev/raidframe/rf_reconstruct.c +++ b/sys/dev/raidframe/rf_reconstruct.c @@ -1,4 +1,4 @@ -/* $NetBSD: rf_reconstruct.c,v 1.65 2004/01/04 21:06:04 oster Exp $ */ +/* $NetBSD: rf_reconstruct.c,v 1.66 2004/02/29 04:03:50 oster Exp $ */ /* * Copyright (c) 1995 Carnegie-Mellon University. * All rights reserved. @@ -33,7 +33,7 @@ ************************************************************/ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: rf_reconstruct.c,v 1.65 2004/01/04 21:06:04 oster Exp $"); +__KERNEL_RCSID(0, "$NetBSD: rf_reconstruct.c,v 1.66 2004/02/29 04:03:50 oster Exp $"); #include <sys/time.h> #include <sys/buf.h> @@ -156,16 +156,11 @@ rf_ShutdownReconstruction(void *ignored) int rf_ConfigureReconstruction(RF_ShutdownList_t **listp) { - int rc; pool_init(&rf_recond_pool, sizeof(RF_RaidReconDesc_t), 0, 0, 0, "rf_recond_pl", NULL); - rc = rf_ShutdownCreate(listp, rf_ShutdownReconstruction, NULL); - if (rc) { - rf_print_unable_to_add_shutdown(__FILE__, __LINE__, rc); - rf_ShutdownReconstruction(NULL); - return (rc); - } + rf_ShutdownCreate(listp, rf_ShutdownReconstruction, NULL); + return (0); } diff --git a/sys/dev/raidframe/rf_revent.c b/sys/dev/raidframe/rf_revent.c index abbdfce864c..336fb58947c 100644 --- a/sys/dev/raidframe/rf_revent.c +++ b/sys/dev/raidframe/rf_revent.c @@ -1,4 +1,4 @@ -/* $NetBSD: rf_revent.c,v 1.14 2003/12/30 21:59:03 oster Exp $ */ +/* $NetBSD: rf_revent.c,v 1.15 2004/02/29 04:03:50 oster Exp $ */ /* * Copyright (c) 1995 Carnegie-Mellon University. * All rights reserved. @@ -30,7 +30,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: rf_revent.c,v 1.14 2003/12/30 21:59:03 oster Exp $"); +__KERNEL_RCSID(0, "$NetBSD: rf_revent.c,v 1.15 2004/02/29 04:03:50 oster Exp $"); #include <sys/errno.h> @@ -71,19 +71,13 @@ static void rf_ShutdownReconEvent(void *ignored) int rf_ConfigureReconEvent(RF_ShutdownList_t **listp) { - int rc; pool_init(&rf_revent_pool, sizeof(RF_ReconEvent_t), 0, 0, 0, "rf_revent_pl", NULL); pool_sethiwat(&rf_revent_pool, RF_MAX_FREE_REVENT); pool_prime(&rf_revent_pool, RF_REVENT_INITIAL); - rc = rf_ShutdownCreate(listp, rf_ShutdownReconEvent, NULL); - if (rc) { - rf_print_unable_to_add_shutdown(__FILE__, __LINE__, rc); - rf_ShutdownReconEvent(NULL); - return (rc); - } + rf_ShutdownCreate(listp, rf_ShutdownReconEvent, NULL); return (0); } diff --git a/sys/dev/raidframe/rf_shutdown.c b/sys/dev/raidframe/rf_shutdown.c index dfd8bef8162..13963aa1c24 100644 --- a/sys/dev/raidframe/rf_shutdown.c +++ b/sys/dev/raidframe/rf_shutdown.c @@ -1,4 +1,4 @@ -/* $NetBSD: rf_shutdown.c,v 1.15 2003/12/30 21:59:03 oster Exp $ */ +/* $NetBSD: rf_shutdown.c,v 1.16 2004/02/29 04:03:50 oster Exp $ */ /* * rf_shutdown.c */ @@ -34,7 +34,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: rf_shutdown.c,v 1.15 2003/12/30 21:59:03 oster Exp $"); +__KERNEL_RCSID(0, "$NetBSD: rf_shutdown.c,v 1.16 2004/02/29 04:03:50 oster Exp $"); #include <dev/raidframe/raidframevar.h> @@ -55,7 +55,7 @@ rf_FreeShutdownEnt(RF_ShutdownList_t *ent) FREE(ent, M_RAIDFRAME); } -int +void _rf_ShutdownCreate(RF_ShutdownList_t **listp, void (*cleanup)(void *arg), void *arg, char *file, int line) { @@ -68,16 +68,13 @@ _rf_ShutdownCreate(RF_ShutdownList_t **listp, void (*cleanup)(void *arg), /* ent = (RF_ShutdownList_t *) malloc(sizeof(RF_ShutdownList_t), M_RAIDFRAME, M_WAITOK); */ ent = (RF_ShutdownList_t *) malloc(sizeof(RF_ShutdownList_t), - M_RAIDFRAME, M_NOWAIT); - if (ent == NULL) - return (ENOMEM); + M_RAIDFRAME, M_WAITOK); ent->cleanup = cleanup; ent->arg = arg; ent->file = file; ent->line = line; ent->next = *listp; *listp = ent; - return (0); } int diff --git a/sys/dev/raidframe/rf_shutdown.h b/sys/dev/raidframe/rf_shutdown.h index 5512b235b03..b160cdf47c5 100644 --- a/sys/dev/raidframe/rf_shutdown.h +++ b/sys/dev/raidframe/rf_shutdown.h @@ -1,4 +1,4 @@ -/* $NetBSD: rf_shutdown.h,v 1.3 2001/10/04 15:58:56 oster Exp $ */ +/* $NetBSD: rf_shutdown.h,v 1.4 2004/02/29 04:03:50 oster Exp $ */ /* * rf_shutdown.h */ @@ -60,7 +60,7 @@ struct RF_ShutdownList_s { #define rf_ShutdownCreate(_listp_,_func_,_arg_) \ _rf_ShutdownCreate(_listp_,_func_,_arg_,__FILE__,__LINE__) -int _rf_ShutdownCreate(RF_ShutdownList_t ** listp, void (*cleanup) (void *arg), +void _rf_ShutdownCreate(RF_ShutdownList_t ** listp, void (*cleanup) (void *arg), void *arg, char *file, int line); int rf_ShutdownList(RF_ShutdownList_t ** listp); diff --git a/sys/dev/raidframe/rf_stripelocks.c b/sys/dev/raidframe/rf_stripelocks.c index 64c711ea895..c310091d174 100644 --- a/sys/dev/raidframe/rf_stripelocks.c +++ b/sys/dev/raidframe/rf_stripelocks.c @@ -1,4 +1,4 @@ -/* $NetBSD: rf_stripelocks.c,v 1.22 2004/01/23 01:57:08 oster Exp $ */ +/* $NetBSD: rf_stripelocks.c,v 1.23 2004/02/29 04:03:50 oster Exp $ */ /* * Copyright (c) 1995 Carnegie-Mellon University. * All rights reserved. @@ -57,7 +57,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: rf_stripelocks.c,v 1.22 2004/01/23 01:57:08 oster Exp $"); +__KERNEL_RCSID(0, "$NetBSD: rf_stripelocks.c,v 1.23 2004/02/29 04:03:50 oster Exp $"); #include <dev/raidframe/raidframevar.h> @@ -169,19 +169,13 @@ int rf_ConfigureStripeLockFreeList(RF_ShutdownList_t **listp) { unsigned mask; - int rc; pool_init(&rf_stripelock_pool, sizeof(RF_StripeLockDesc_t), 0, 0, 0, "rf_stripelock_pl", NULL); pool_sethiwat(&rf_stripelock_pool, RF_MAX_FREE_STRIPELOCK); pool_prime(&rf_stripelock_pool, RF_STRIPELOCK_INITIAL); - rc = rf_ShutdownCreate(listp, rf_ShutdownStripeLockFreeList, NULL); - if (rc) { - rf_print_unable_to_add_shutdown(__FILE__, __LINE__, rc); - rf_ShutdownStripeLockFreeList(NULL); - return (rc); - } + rf_ShutdownCreate(listp, rf_ShutdownStripeLockFreeList, NULL); for (mask = 0x1; mask; mask <<= 1) if (rf_lockTableSize == mask) @@ -233,17 +227,12 @@ int rf_ConfigureStripeLocks(RF_ShutdownList_t **listp, RF_Raid_t *raidPtr, RF_Config_t *cfgPtr) { - int rc; raidPtr->lockTable = rf_MakeLockTable(); if (raidPtr->lockTable == NULL) return (ENOMEM); - rc = rf_ShutdownCreate(listp, rf_RaidShutdownStripeLocks, raidPtr); - if (rc) { - rf_print_unable_to_add_shutdown(__FILE__, __LINE__, rc); - rf_ShutdownStripeLocks(raidPtr->lockTable); - return (rc); - } + rf_ShutdownCreate(listp, rf_RaidShutdownStripeLocks, raidPtr); + return (0); } /* returns 0 if you've got the lock, and non-zero if you have to wait. |
