PERFORCE change 54262 for review
Scott Long
scottl at FreeBSD.org
Sun Jun 6 11:27:28 GMT 2004
http://perforce.freebsd.org/chv.cgi?CH=54262
Change 54262 by scottl at scottl-esp-sparc64 on 2004/06/06 11:26:55
Change to the uma API.
Affected files ...
.. //depot/projects/scottl-esp/src/sys/dev/esp/ncr53c9x.c#6 edit
Differences ...
==== //depot/projects/scottl-esp/src/sys/dev/esp/ncr53c9x.c#6 (text+ko) ====
@@ -87,6 +87,7 @@
#include <sys/lock.h>
#include <sys/mutex.h>
#include <sys/queue.h>
+#include <vm/uma.h>
#include <cam/cam.h>
#include <cam/cam_ccb.h>
@@ -144,8 +145,8 @@
} \
} while (0)
-static int ecb_pool_initialized = 0;
-static struct pool ecb_pool;
+static int ecb_zone_initialized = 0;
+static uma_zone_t ecb_zone;
/*
* Names for the NCR53c9x variants, correspnding to the variant tags
@@ -430,11 +431,12 @@
NCR_MISC(("[NCR_INIT(%d) %d] ", doreset, sc->sc_state));
- if (!ecb_pool_initialized) {
- /* All instances share this pool */
- pool_init(&ecb_pool, sizeof(struct ncr53c9x_ecb), 0, 0, 0,
- "ncr53c9x_ecb", NULL);
- ecb_pool_initialized = 1;
+ if (!ecb_zone_initialized) {
+ /* All instances share this zone */
+ ecb_zone = uma_zcreate("ncr53c9x ecb zone",
+ sizeof(struct ncr53c9x_ecb), NULL, NULL,
+ NULL, NULL, 8, M_NOWAIT);
+ ecb_zone_initialized = 1;
}
if (sc->sc_state == 0) {
@@ -777,7 +779,7 @@
{
ecb->flags = 0;
- pool_put(&ecb_pool, (void *)ecb);
+ uma_zfree(ecb_zone, (void *)ecb);
return;
}
@@ -788,7 +790,7 @@
{
struct ncr53c9x_ecb *ecb;
- ecb = (struct ncr53c9x_ecb *)pool_get(&ecb_pool, PR_NOWAIT);
+ ecb = (struct ncr53c9x_ecb *)uma_zalloc(ecb_zone, M_NOWAIT);
if (ecb) {
memset(ecb, 0, sizeof(*ecb));
ecb->flags |= ECB_ALLOC;
More information about the p4-projects
mailing list