diff options
| author | oster <oster@NetBSD.org> | 2004-03-20 04:22:05 +0000 |
|---|---|---|
| committer | oster <oster@NetBSD.org> | 2004-03-20 04:22:05 +0000 |
| commit | 0ff214564803add4a3a9ef738c0dd02b41f2ff38 (patch) | |
| tree | 5b812f74f0b9cee4b4fa44dae5b864947345022c /sys/dev/raidframe/rf_map.h | |
| parent | 068442743911ba78048d0658f611997a42661a9c (diff) | |
For each RAID set, pre-allocate a number of "emergency buffers" to be
used in the event that we can't malloc a buffer of the appropriate
size in the traditional way. rf_AllocIOBuffer() and rf_FreeIOBuffer()
deal with allocating/freeing these structures. These buffers are
stored in a list on the 'iobuf' list. iobuf_count keeps track of how
many buffers are available, and numEmergencyBuffers is the effective
"high-water" mark for the freelist. The buffers allocated by
rf_AllocIOBuffer() are stripe-unit sized, which is the maximum
size requested by any of the callers.
Add an iobufs entry to RF_DagHeader_s. Use it for keeping track of
buffers that get allocated from the free-list.
Add a "generic list" pool (VoidPointerListElement Pool) for elements
used to maintain a list of allocated memory. [It is somewhat less
than ideal to add another little pool to handle this...]
Teach rf_AllocBuffer() to use the new rf_AllocIOBuffer(). Modify
other Mallocs to use rf_AllocIOBuffer(), and to update dag_h->iobufs as
appropriate.
Update rf_FreeDAG() to handle cleanup of dag_h->iobufs.
While here, add some missing pool_destroy() calls for a number of pools.
With these changes, it should (in theory) be possible to swap on
RAID 5 sets again. That said, I've not had any success there yet --
but the last issue I saw at least wasn't in RAIDframe. :-}
[There is room for this code to become a bit more consise, but I
wanted to do a checkpoint here with something known to work :) ]
Diffstat (limited to 'sys/dev/raidframe/rf_map.h')
| -rw-r--r-- | sys/dev/raidframe/rf_map.h | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/sys/dev/raidframe/rf_map.h b/sys/dev/raidframe/rf_map.h index c25a1d3f631..cc177ba3dd1 100644 --- a/sys/dev/raidframe/rf_map.h +++ b/sys/dev/raidframe/rf_map.h @@ -1,4 +1,4 @@ -/* $NetBSD: rf_map.h,v 1.10 2004/03/19 02:27:44 oster Exp $ */ +/* $NetBSD: rf_map.h,v 1.11 2004/03/20 04:22:05 oster Exp $ */ /* * Copyright (c) 1995 Carnegie-Mellon University. * All rights reserved. @@ -60,6 +60,8 @@ void rf_ASMCheckStatus(RF_Raid_t *, RF_PhysDiskAddr_t *, RF_AccessStripeMap_t *, RF_VoidFunctionPointerListElem_t *rf_AllocVFPListElem(void); void rf_FreeVFPListElem(RF_VoidFunctionPointerListElem_t *); +RF_VoidPointerListElem_t *rf_AllocVPListElem(void); +void rf_FreeVPListElem(RF_VoidPointerListElem_t *); RF_ASMHeaderListElem_t *rf_AllocASMHeaderListElem(void); void rf_FreeASMHeaderListElem(RF_ASMHeaderListElem_t *); RF_FailedStripe_t *rf_AllocFailedStripeStruct(void); |
