summaryrefslogtreecommitdiff
path: root/sys/dev/raidframe/rf_callback.c
diff options
context:
space:
mode:
authoroster <oster@NetBSD.org>2003-12-29 03:33:47 +0000
committeroster <oster@NetBSD.org>2003-12-29 03:33:47 +0000
commitee19b085aa7404f91d9876986c2070b47e6f1399 (patch)
treea9c852447a8a7f093056262151734dfea2b0b4d4 /sys/dev/raidframe/rf_callback.c
parentb852db83fb14fe9a32a03051ea869b353a2d8534 (diff)
- first kick at a major reworking of RAIDframe's memory allocation code:
- all freelists converted to pools - initialization of structure members in certain cases where code was relying on specific allocation and usage properties to keep structures in a "known state" (that doesn't work with pools!). - make most pool_get() be "PR_WAITOK" until they can be analyzed further, and/or have proper error handling added. - all RF_Mallocs zero the space returned, so there is no difference between RF_Calloc and RF_Malloc. In fact, all the RF_Calloc()'s do is tend to do is get things horribly confused. Make RF_Malloc() the "general memory allocator", with RF_MallocAndAdd() the "general memory allocator with allocation list". - some of these RF_Malloc's et al. are destined to disappear. - remove rf_rdp_freelist entirely (it's not used anywhere!) - remove: #include "rf_freelist.h" - to the files that were relying on the above, add: #include "rf_general.h" - add: #include "rf_debugMem.h" to rf_shutdown.h to make it happy about the loss of: #include "rf_freelist.h". This shrinks an i386 GENERIC kernel by approx 5K. RAIDframe now weighs in at about 162K on i386.
Diffstat (limited to 'sys/dev/raidframe/rf_callback.c')
-rw-r--r--sys/dev/raidframe/rf_callback.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/sys/dev/raidframe/rf_callback.c b/sys/dev/raidframe/rf_callback.c
index c2f74a64d66..7febce4799a 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.10 2003/12/21 15:56:20 oster Exp $ */
+/* $NetBSD: rf_callback.c,v 1.11 2003/12/29 03:33:47 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.10 2003/12/21 15:56:20 oster Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rf_callback.c,v 1.11 2003/12/29 03:33:47 oster Exp $");
#include <dev/raidframe/raidframevar.h>
#include <sys/pool.h>
@@ -43,11 +43,10 @@ __KERNEL_RCSID(0, "$NetBSD: rf_callback.c,v 1.10 2003/12/21 15:56:20 oster Exp $
#include "rf_threadstuff.h"
#include "rf_callback.h"
#include "rf_debugMem.h"
-#include "rf_freelist.h"
+#include "rf_general.h"
#include "rf_shutdown.h"
static struct pool rf_callback_pool;
-
#define RF_MAX_FREE_CALLBACK 64
#define RF_CALLBACK_INC 4
#define RF_CALLBACK_INITIAL 32
@@ -85,7 +84,7 @@ rf_AllocCallbackDesc()
{
RF_CallbackDesc_t *p;
- p = pool_get(&rf_callback_pool, PR_NOWAIT);
+ p = pool_get(&rf_callback_pool, PR_WAITOK);
return (p);
}