diff options
| author | oster <oster@NetBSD.org> | 2004-03-07 22:15:19 +0000 |
|---|---|---|
| committer | oster <oster@NetBSD.org> | 2004-03-07 22:15:19 +0000 |
| commit | f95359dd191148186105e4fa81f344167d75fac1 (patch) | |
| tree | b454f59c57dd89a537d27b6b3979fa64870a2956 /sys/dev/raidframe | |
| parent | 834d494bb273a9c85833dc59452ba403b7c36d0e (diff) | |
- Introduce rf_pools which contains all of the various global pools used
by RAIDframe. Convert all other RAIDframe global pools to use pools
defined within this new structure.
- Introduce rf_pool_init(), used for initializing a single pool in
RAIDframe. Teach each of the configuration routines to use
rf_pool_init().
- Cleanup a few pool-related comments.
- Cleanup revent initialization and #defines.
- Add a missing pool_destroy() for the reconbuffer pool.
(Saves another 1K off of an i386 GENERIC kernel, and makes
stuff a lot more readable)
Diffstat (limited to 'sys/dev/raidframe')
| -rw-r--r-- | sys/dev/raidframe/rf_alloclist.c | 4 | ||||
| -rw-r--r-- | sys/dev/raidframe/rf_callback.c | 4 | ||||
| -rw-r--r-- | sys/dev/raidframe/rf_dagutils.c | 4 | ||||
| -rw-r--r-- | sys/dev/raidframe/rf_diskqueue.c | 4 | ||||
| -rw-r--r-- | sys/dev/raidframe/rf_driver.c | 4 | ||||
| -rw-r--r-- | sys/dev/raidframe/rf_map.c | 4 | ||||
| -rw-r--r-- | sys/dev/raidframe/rf_mcpair.c | 20 | ||||
| -rw-r--r-- | sys/dev/raidframe/rf_netbsd.h | 28 | ||||
| -rw-r--r-- | sys/dev/raidframe/rf_netbsdkintf.c | 4 | ||||
| -rw-r--r-- | sys/dev/raidframe/rf_psstatus.c | 21 | ||||
| -rw-r--r-- | sys/dev/raidframe/rf_reconstruct.c | 30 | ||||
| -rw-r--r-- | sys/dev/raidframe/rf_reconutil.c | 8 | ||||
| -rw-r--r-- | sys/dev/raidframe/rf_revent.c | 23 | ||||
| -rw-r--r-- | sys/dev/raidframe/rf_stripelocks.c | 19 |
14 files changed, 84 insertions, 93 deletions
diff --git a/sys/dev/raidframe/rf_alloclist.c b/sys/dev/raidframe/rf_alloclist.c index 46f2b493799..cbd5db2bb0f 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.20 2004/03/07 21:57:44 oster Exp $ */ +/* $NetBSD: rf_alloclist.c,v 1.21 2004/03/07 22:15:19 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.20 2004/03/07 21:57:44 oster Exp $"); +__KERNEL_RCSID(0, "$NetBSD: rf_alloclist.c,v 1.21 2004/03/07 22:15:19 oster Exp $"); #include <dev/raidframe/raidframevar.h> diff --git a/sys/dev/raidframe/rf_callback.c b/sys/dev/raidframe/rf_callback.c index b67315a6669..ee358050166 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.15 2004/03/07 21:57:44 oster Exp $ */ +/* $NetBSD: rf_callback.c,v 1.16 2004/03/07 22:15:19 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.15 2004/03/07 21:57:44 oster Exp $"); +__KERNEL_RCSID(0, "$NetBSD: rf_callback.c,v 1.16 2004/03/07 22:15:19 oster Exp $"); #include <dev/raidframe/raidframevar.h> #include <sys/pool.h> diff --git a/sys/dev/raidframe/rf_dagutils.c b/sys/dev/raidframe/rf_dagutils.c index 521880c6b36..b1c77db522c 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.36 2004/03/07 21:57:44 oster Exp $ */ +/* $NetBSD: rf_dagutils.c,v 1.37 2004/03/07 22:15:19 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.36 2004/03/07 21:57:44 oster Exp $"); +__KERNEL_RCSID(0, "$NetBSD: rf_dagutils.c,v 1.37 2004/03/07 22:15:19 oster Exp $"); #include <dev/raidframe/raidframevar.h> diff --git a/sys/dev/raidframe/rf_diskqueue.c b/sys/dev/raidframe/rf_diskqueue.c index a40b825a0fd..248ad8e3ef1 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.32 2004/03/07 21:57:44 oster Exp $ */ +/* $NetBSD: rf_diskqueue.c,v 1.33 2004/03/07 22:15:19 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.32 2004/03/07 21:57:44 oster Exp $"); +__KERNEL_RCSID(0, "$NetBSD: rf_diskqueue.c,v 1.33 2004/03/07 22:15:19 oster Exp $"); #include <dev/raidframe/raidframevar.h> diff --git a/sys/dev/raidframe/rf_driver.c b/sys/dev/raidframe/rf_driver.c index 32813580077..deee110fe74 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.89 2004/03/07 21:57:45 oster Exp $ */ +/* $NetBSD: rf_driver.c,v 1.90 2004/03/07 22:15:19 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.89 2004/03/07 21:57:45 oster Exp $"); +__KERNEL_RCSID(0, "$NetBSD: rf_driver.c,v 1.90 2004/03/07 22:15:19 oster Exp $"); #include "opt_raid_diagnostic.h" diff --git a/sys/dev/raidframe/rf_map.c b/sys/dev/raidframe/rf_map.c index f16e1575188..121cc7a4104 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.32 2004/03/07 21:57:44 oster Exp $ */ +/* $NetBSD: rf_map.c,v 1.33 2004/03/07 22:15:19 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.32 2004/03/07 21:57:44 oster Exp $"); +__KERNEL_RCSID(0, "$NetBSD: rf_map.c,v 1.33 2004/03/07 22:15:19 oster Exp $"); #include <dev/raidframe/raidframevar.h> diff --git a/sys/dev/raidframe/rf_mcpair.c b/sys/dev/raidframe/rf_mcpair.c index 48ba8ad4a2a..a5619006683 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.16 2004/03/05 02:53:58 oster Exp $ */ +/* $NetBSD: rf_mcpair.c,v 1.17 2004/03/07 22:15:19 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.16 2004/03/05 02:53:58 oster Exp $"); +__KERNEL_RCSID(0, "$NetBSD: rf_mcpair.c,v 1.17 2004/03/07 22:15:19 oster Exp $"); #include <dev/raidframe/raidframevar.h> @@ -42,11 +42,11 @@ __KERNEL_RCSID(0, "$NetBSD: rf_mcpair.c,v 1.16 2004/03/05 02:53:58 oster Exp $") #include "rf_debugMem.h" #include "rf_general.h" #include "rf_shutdown.h" +#include "rf_netbsd.h" #include <sys/pool.h> #include <sys/proc.h> -static struct pool rf_mcpair_pool; #define RF_MAX_FREE_MCPAIR 128 #define RF_MIN_FREE_MCPAIR 24 @@ -55,19 +55,15 @@ static void rf_ShutdownMCPair(void *); static void rf_ShutdownMCPair(void *ignored) { - pool_destroy(&rf_mcpair_pool); + pool_destroy(&rf_pools.mcpair); } int rf_ConfigureMCPair(RF_ShutdownList_t **listp) { - 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_MIN_FREE_MCPAIR); - pool_setlowat(&rf_mcpair_pool, RF_MIN_FREE_MCPAIR); - + rf_pool_init(&rf_pools.mcpair, sizeof(RF_MCPair_t), + "rf_mcpair_pl", RF_MIN_FREE_MCPAIR, RF_MAX_FREE_MCPAIR); rf_ShutdownCreate(listp, rf_ShutdownMCPair, NULL); return (0); @@ -78,7 +74,7 @@ rf_AllocMCPair() { RF_MCPair_t *t; - t = pool_get(&rf_mcpair_pool, PR_WAITOK); + t = pool_get(&rf_pools.mcpair, PR_WAITOK); simple_lock_init(&t->mutex); t->cond = 0; t->flag = 0; @@ -89,7 +85,7 @@ rf_AllocMCPair() void rf_FreeMCPair(RF_MCPair_t *t) { - pool_put(&rf_mcpair_pool, t); + pool_put(&rf_pools.mcpair, t); } /* the callback function used to wake you up when you use an mcpair to diff --git a/sys/dev/raidframe/rf_netbsd.h b/sys/dev/raidframe/rf_netbsd.h index 09bdd2cff49..b41015ea619 100644 --- a/sys/dev/raidframe/rf_netbsd.h +++ b/sys/dev/raidframe/rf_netbsd.h @@ -1,4 +1,4 @@ -/* $NetBSD: rf_netbsd.h,v 1.13 2001/10/04 15:58:54 oster Exp $ */ +/* $NetBSD: rf_netbsd.h,v 1.14 2004/03/07 22:15:19 oster Exp $ */ /*- * Copyright (c) 1996, 1997, 1998 The NetBSD Foundation, Inc. @@ -43,6 +43,7 @@ #include <sys/systm.h> #include <sys/namei.h> #include <sys/vnode.h> +#include <sys/pool.h> #include <dev/raidframe/raidframevar.h> @@ -58,6 +59,31 @@ struct raidcinfo { }; +/* a little structure to serve as a container for all the various + global pools used in RAIDframe */ + +struct RF_Pools_s { + struct pool alloclist; /* AllocList */ + struct pool asm_hdr; /* Access Stripe Map Header */ + struct pool asmap; /* Access Stripe Map */ + struct pool callback; /* Callback descriptors */ + struct pool cbuf; /* Component buffers */ + struct pool dagh; /* DAG headers */ + struct pool daglist; /* DAG lists */ + struct pool dqd; /* Disk Queue Data */ + struct pool funclist; /* Function Lists */ + struct pool mcpair; /* Mutex/Cond Pairs */ + struct pool pda; /* Physical Disk Access structures */ + struct pool rad; /* Raid Access Descriptors */ + struct pool recond; /* reconstruction descriptors */ + struct pool reconbuffer; /* reconstruction buffer (header) pool */ + struct pool revent; /* reconstruct events */ + struct pool stripelock; /* StripeLock */ +}; + +extern struct RF_Pools_s rf_pools; +void rf_pool_init(struct pool *, size_t, char *, size_t, size_t); + /* XXX probably belongs in a different .h file. */ typedef struct RF_AutoConfig_s { diff --git a/sys/dev/raidframe/rf_netbsdkintf.c b/sys/dev/raidframe/rf_netbsdkintf.c index 502a4a9bf60..1714d00e4b1 100644 --- a/sys/dev/raidframe/rf_netbsdkintf.c +++ b/sys/dev/raidframe/rf_netbsdkintf.c @@ -1,4 +1,4 @@ -/* $NetBSD: rf_netbsdkintf.c,v 1.177 2004/03/07 21:57:44 oster Exp $ */ +/* $NetBSD: rf_netbsdkintf.c,v 1.178 2004/03/07 22:15:19 oster Exp $ */ /*- * Copyright (c) 1996, 1997, 1998 The NetBSD Foundation, Inc. * All rights reserved. @@ -146,7 +146,7 @@ ***********************************************************/ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: rf_netbsdkintf.c,v 1.177 2004/03/07 21:57:44 oster Exp $"); +__KERNEL_RCSID(0, "$NetBSD: rf_netbsdkintf.c,v 1.178 2004/03/07 22:15:19 oster Exp $"); #include <sys/param.h> #include <sys/errno.h> diff --git a/sys/dev/raidframe/rf_psstatus.c b/sys/dev/raidframe/rf_psstatus.c index c46881d4855..2786147418f 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.25 2004/03/05 02:53:58 oster Exp $ */ +/* $NetBSD: rf_psstatus.c,v 1.26 2004/03/07 22:15:19 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.25 2004/03/05 02:53:58 oster Exp $"); +__KERNEL_RCSID(0, "$NetBSD: rf_psstatus.c,v 1.26 2004/03/07 22:15:19 oster Exp $"); #include <dev/raidframe/raidframevar.h> @@ -81,19 +81,10 @@ rf_ConfigurePSStatus(RF_ShutdownList_t **listp, RF_Raid_t *raidPtr, { raidPtr->pssTableSize = RF_PSS_DEFAULT_TABLESIZE; - pool_init(&raidPtr->pss_pool, sizeof(RF_ReconParityStripeStatus_t), 0, - 0, 0, "raidpsspl", NULL); - pool_sethiwat(&raidPtr->pss_pool, RF_MAX_FREE_PSS); - pool_prime(&raidPtr->pss_pool, RF_MIN_FREE_PSS); - pool_setlowat(&raidPtr->pss_pool, RF_MIN_FREE_PSS); - - pool_init(&raidPtr->pss_issued_pool, - raidPtr->numCol * sizeof(char), 0, - 0, 0, "raidpssissuedpl", NULL); - pool_sethiwat(&raidPtr->pss_issued_pool, RF_MAX_FREE_PSS); - pool_prime(&raidPtr->pss_issued_pool, RF_MIN_FREE_PSS); - pool_setlowat(&raidPtr->pss_issued_pool, RF_MIN_FREE_PSS); - + rf_pool_init(&raidPtr->pss_pool, sizeof(RF_ReconParityStripeStatus_t), + "raidpsspl", RF_MIN_FREE_PSS, RF_MAX_FREE_PSS); + rf_pool_init(&raidPtr->pss_issued_pool, raidPtr->numCol * sizeof(char), + "raidpssissuedpl", RF_MIN_FREE_PSS, RF_MAX_FREE_PSS); rf_ShutdownCreate(listp, rf_ShutdownPSStatus, raidPtr); return (0); diff --git a/sys/dev/raidframe/rf_reconstruct.c b/sys/dev/raidframe/rf_reconstruct.c index c0e3770678d..60b6af7deac 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.73 2004/03/07 02:46:58 oster Exp $ */ +/* $NetBSD: rf_reconstruct.c,v 1.74 2004/03/07 22:15:19 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.73 2004/03/07 02:46:58 oster Exp $"); +__KERNEL_RCSID(0, "$NetBSD: rf_reconstruct.c,v 1.74 2004/03/07 22:15:19 oster Exp $"); #include <sys/time.h> #include <sys/buf.h> @@ -95,11 +95,9 @@ __KERNEL_RCSID(0, "$NetBSD: rf_reconstruct.c,v 1.73 2004/03/07 02:46:58 oster Ex #endif /* RF_DEBUG_RECON */ -static struct pool rf_recond_pool; #define RF_MAX_FREE_RECOND 10 #define RF_MIN_FREE_RECOND 4 -struct pool rf_reconbuffer_pool; #define RF_MAX_FREE_RECONBUFFER 32 #define RF_MIN_FREE_RECONBUFFER 16 @@ -145,25 +143,18 @@ struct RF_ReconDoneProc_s { static void rf_ShutdownReconstruction(void *ignored) { - pool_destroy(&rf_recond_pool); + pool_destroy(&rf_pools.recond); + pool_destroy(&rf_pools.reconbuffer); } int rf_ConfigureReconstruction(RF_ShutdownList_t **listp) { - pool_init(&rf_recond_pool, sizeof(RF_RaidReconDesc_t), 0, 0, 0, - "rf_recond_pl", NULL); - pool_sethiwat(&rf_recond_pool,RF_MAX_FREE_RECOND); - pool_prime(&rf_recond_pool,RF_MIN_FREE_RECOND); - pool_sethiwat(&rf_recond_pool,RF_MIN_FREE_RECOND); - - pool_init(&rf_reconbuffer_pool, sizeof(RF_ReconBuffer_t), 0, 0, 0, - "rf_reconbuffer_pl", NULL); - pool_sethiwat(&rf_reconbuffer_pool,RF_MAX_FREE_RECONBUFFER); - pool_prime(&rf_reconbuffer_pool,RF_MIN_FREE_RECONBUFFER); - pool_sethiwat(&rf_reconbuffer_pool,RF_MIN_FREE_RECONBUFFER); - + rf_pool_init(&rf_pools.recond, sizeof(RF_RaidReconDesc_t), + "rf_recond_pl", RF_MIN_FREE_RECOND, RF_MAX_FREE_RECOND); + rf_pool_init(&rf_pools.reconbuffer, sizeof(RF_ReconBuffer_t), + "rf_reconbuffer_pl", RF_MIN_FREE_RECONBUFFER, RF_MAX_FREE_RECONBUFFER); rf_ShutdownCreate(listp, rf_ShutdownReconstruction, NULL); return (0); @@ -177,8 +168,7 @@ AllocRaidReconDesc(RF_Raid_t *raidPtr, RF_RowCol_t col, RF_RaidReconDesc_t *reconDesc; - reconDesc = pool_get(&rf_recond_pool, PR_WAITOK); /* XXX WAITOK?? */ - + reconDesc = pool_get(&rf_pools.recond, PR_WAITOK); reconDesc->raidPtr = raidPtr; reconDesc->col = col; reconDesc->spareDiskPtr = spareDiskPtr; @@ -205,7 +195,7 @@ FreeReconDesc(RF_RaidReconDesc_t *reconDesc) #if (RF_RECON_STATS > 0) || defined(KERNEL) printf("\n"); #endif /* (RF_RECON_STATS > 0) || KERNEL */ - pool_put(&rf_recond_pool, reconDesc); + pool_put(&rf_pools.recond, reconDesc); } diff --git a/sys/dev/raidframe/rf_reconutil.c b/sys/dev/raidframe/rf_reconutil.c index cb0ef20b151..d2b9f4a9bc1 100644 --- a/sys/dev/raidframe/rf_reconutil.c +++ b/sys/dev/raidframe/rf_reconutil.c @@ -1,4 +1,4 @@ -/* $NetBSD: rf_reconutil.c,v 1.21 2004/03/07 02:46:59 oster Exp $ */ +/* $NetBSD: rf_reconutil.c,v 1.22 2004/03/07 22:15:19 oster Exp $ */ /* * Copyright (c) 1995 Carnegie-Mellon University. * All rights reserved. @@ -31,7 +31,7 @@ ********************************************/ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: rf_reconutil.c,v 1.21 2004/03/07 02:46:59 oster Exp $"); +__KERNEL_RCSID(0, "$NetBSD: rf_reconutil.c,v 1.22 2004/03/07 22:15:19 oster Exp $"); #include <dev/raidframe/raidframevar.h> @@ -219,7 +219,7 @@ rf_MakeReconBuffer(RF_Raid_t *raidPtr, RF_RowCol_t col, RF_RbufType_t type) RF_ReconBuffer_t *t; u_int recon_buffer_size = rf_RaidAddressToByte(raidPtr, layoutPtr->SUsPerRU * layoutPtr->sectorsPerStripeUnit); - t = pool_get(&rf_reconbuffer_pool, PR_WAITOK); + t = pool_get(&rf_pools.reconbuffer, PR_WAITOK); RF_Malloc(t->buffer, recon_buffer_size, (caddr_t)); t->raidPtr = raidPtr; t->col = col; @@ -241,7 +241,7 @@ rf_FreeReconBuffer(RF_ReconBuffer_t *rbuf) recon_buffer_size = rf_RaidAddressToByte(raidPtr, raidPtr->Layout.SUsPerRU * raidPtr->Layout.sectorsPerStripeUnit); RF_Free(rbuf->buffer, recon_buffer_size); - pool_put(&rf_reconbuffer_pool, rbuf); + pool_put(&rf_pools.reconbuffer, rbuf); } #if RF_DEBUG_RECON diff --git a/sys/dev/raidframe/rf_revent.c b/sys/dev/raidframe/rf_revent.c index c21c1fb094a..7871a16bf03 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.17 2004/03/02 16:03:00 oster Exp $ */ +/* $NetBSD: rf_revent.c,v 1.18 2004/03/07 22:15:19 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.17 2004/03/02 16:03:00 oster Exp $"); +__KERNEL_RCSID(0, "$NetBSD: rf_revent.c,v 1.18 2004/03/07 22:15:19 oster Exp $"); #include <sys/errno.h> @@ -41,12 +41,8 @@ __KERNEL_RCSID(0, "$NetBSD: rf_revent.c,v 1.17 2004/03/02 16:03:00 oster Exp $") #include "rf_desc.h" #include "rf_shutdown.h" -static struct pool rf_revent_pool; #define RF_MAX_FREE_REVENT 128 -#define RF_REVENT_INC 8 -#define RF_REVENT_INITIAL 8 - - +#define RF_MIN_FREE_REVENT 32 #include <sys/proc.h> #include <sys/kernel.h> @@ -58,18 +54,15 @@ GetReconEventDesc(RF_RowCol_t col, void *arg, RF_Revent_t type); static void rf_ShutdownReconEvent(void *ignored) { - pool_destroy(&rf_revent_pool); + pool_destroy(&rf_pools.revent); } int rf_ConfigureReconEvent(RF_ShutdownList_t **listp) { - 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); - + rf_pool_init(&rf_pools.revent, sizeof(RF_ReconEvent_t), + "rf_revent_pl", RF_MIN_FREE_REVENT, RF_MAX_FREE_REVENT); rf_ShutdownCreate(listp, rf_ShutdownReconEvent, NULL); return (0); @@ -185,7 +178,7 @@ GetReconEventDesc(RF_RowCol_t col, void *arg, RF_Revent_t type) { RF_ReconEvent_t *t; - t = pool_get(&rf_revent_pool, PR_WAITOK); + t = pool_get(&rf_pools.revent, PR_WAITOK); t->col = col; t->arg = arg; t->type = type; @@ -196,5 +189,5 @@ GetReconEventDesc(RF_RowCol_t col, void *arg, RF_Revent_t type) void rf_FreeReconEventDesc(RF_ReconEvent_t *event) { - pool_put(&rf_revent_pool, event); + pool_put(&rf_pools.revent, event); } diff --git a/sys/dev/raidframe/rf_stripelocks.c b/sys/dev/raidframe/rf_stripelocks.c index f91aea4ca69..275b797745a 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.24 2004/03/05 02:53:58 oster Exp $ */ +/* $NetBSD: rf_stripelocks.c,v 1.25 2004/03/07 22:15:19 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.24 2004/03/05 02:53:58 oster Exp $"); +__KERNEL_RCSID(0, "$NetBSD: rf_stripelocks.c,v 1.25 2004/03/07 22:15:19 oster Exp $"); #include <dev/raidframe/raidframevar.h> @@ -150,7 +150,6 @@ static void PrintLockedStripes(RF_LockTableEntry_t * lockTable); ) \ ) -static struct pool rf_stripelock_pool; #define RF_MAX_FREE_STRIPELOCK 128 #define RF_MIN_FREE_STRIPELOCK 32 @@ -161,7 +160,7 @@ static void rf_RaidShutdownStripeLocks(void *); static void rf_ShutdownStripeLockFreeList(void *ignored) { - pool_destroy(&rf_stripelock_pool); + pool_destroy(&rf_pools.stripelock); } int @@ -169,12 +168,8 @@ rf_ConfigureStripeLockFreeList(RF_ShutdownList_t **listp) { unsigned mask; - 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_MIN_FREE_STRIPELOCK); - pool_setlowat(&rf_stripelock_pool, RF_MIN_FREE_STRIPELOCK); - + rf_pool_init(&rf_pools.stripelock, sizeof(RF_StripeLockDesc_t), + "rf_stripelock_pl", RF_MIN_FREE_STRIPELOCK, RF_MAX_FREE_STRIPELOCK); rf_ShutdownCreate(listp, rf_ShutdownStripeLockFreeList, NULL); for (mask = 0x1; mask; mask <<= 1) @@ -637,7 +632,7 @@ AllocStripeLockDesc(RF_StripeNum_t stripeID) { RF_StripeLockDesc_t *p; - p = pool_get(&rf_stripelock_pool, PR_WAITOK); + p = pool_get(&rf_pools.stripelock, PR_WAITOK); if (p) { p->stripeID = stripeID; p->granted = NULL; @@ -652,7 +647,7 @@ AllocStripeLockDesc(RF_StripeNum_t stripeID) static void FreeStripeLockDesc(RF_StripeLockDesc_t *p) { - pool_put(&rf_stripelock_pool, p); + pool_put(&rf_pools.stripelock, p); } #if RF_DEBUG_STRIPELOCK |
