summaryrefslogtreecommitdiffstats
path: root/sys/netatm
diff options
context:
space:
mode:
authorarr <arr@FreeBSD.org>2002-05-24 00:38:25 +0000
committerarr <arr@FreeBSD.org>2002-05-24 00:38:25 +0000
commitd756e3ff88238ac6a0deb498bda602333d20ddb3 (patch)
tree95f9fdc37ec7b8c9b4b69b7fd0939e3958ecb5f3 /sys/netatm
parent52bc2e2b225519bc815454628afae9ce2a78c3bb (diff)
downloadFreeBSD-src-d756e3ff88238ac6a0deb498bda602333d20ddb3.zip
FreeBSD-src-d756e3ff88238ac6a0deb498bda602333d20ddb3.tar.gz
- Turn a couple of storage pools into UMA zones and their associated calls
to the appropriate UMA api calls.
Diffstat (limited to 'sys/netatm')
-rw-r--r--sys/netatm/sigpvc/sigpvc_if.c17
-rw-r--r--sys/netatm/sigpvc/sigpvc_subr.c6
2 files changed, 13 insertions, 10 deletions
diff --git a/sys/netatm/sigpvc/sigpvc_if.c b/sys/netatm/sigpvc/sigpvc_if.c
index b484198..dbeba74 100644
--- a/sys/netatm/sigpvc/sigpvc_if.c
+++ b/sys/netatm/sigpvc/sigpvc_if.c
@@ -67,6 +67,8 @@
#include <netatm/sigpvc/sigpvc_var.h>
+#include <vm/uma.h>
+
#ifndef lint
__RCSID("@(#) $FreeBSD$");
#endif
@@ -75,12 +77,7 @@ __RCSID("@(#) $FreeBSD$");
/*
* Global variables
*/
-struct sp_info sigpvc_vcpool = {
- "sigpvc vcc pool", /* si_name */
- sizeof(struct sigpvc_vccb), /* si_blksiz */
- 10, /* si_blkcnt */
- 50 /* si_maxallow */
-};
+uma_zone_t sigpvc_vc_zone;
/*
* Local functions
@@ -153,6 +150,10 @@ sigpvc_start()
return (EINVAL);
}
+ sigpvc_vc_zone = uma_zcreate("sigpvc vc", sizeof(struct sigpvc_vccb),
+ NULL, NULL, NULL, NULL, UMA_ALIGN_PTR, 0);
+ uma_zone_set_max(sigpvc_vc_zone, 50);
+
/*
* Register ourselves with system
*/
@@ -209,7 +210,7 @@ sigpvc_stop()
/*
* Free up our vccb storage pool
*/
- atm_release_pool(&sigpvc_vcpool);
+ uma_zdestroy(sigpvc_vc_zone);
} else
err = ENXIO;
@@ -510,7 +511,7 @@ sigpvc_free(vcp)
*/
vcp->vc_ustate = VCCU_NULL;
vcp->vc_sstate = VCCS_NULL;
- atm_free((caddr_t)vcp);
+ uma_zfree(sigpvc_vc_zone, vcp);
/*
* If we're detaching and this was the last vcc queued,
diff --git a/sys/netatm/sigpvc/sigpvc_subr.c b/sys/netatm/sigpvc/sigpvc_subr.c
index bb40c44..995979e 100644
--- a/sys/netatm/sigpvc/sigpvc_subr.c
+++ b/sys/netatm/sigpvc/sigpvc_subr.c
@@ -57,11 +57,13 @@
#include <netatm/sigpvc/sigpvc_var.h>
+#include <vm/uma.h>
+
#ifndef lint
__RCSID("@(#) $FreeBSD$");
#endif
-extern struct sp_info sigpvc_vcpool;
+extern uma_zone_t sigpvc_vc_zone;
/*
* Create a SigPVC Permanent Virtual Channel
@@ -127,7 +129,7 @@ sigpvc_create_pvc(pvp, cvp, errp)
/*
* Allocate control block for PVC
*/
- vcp = (struct vccb *)atm_allocate(&sigpvc_vcpool);
+ vcp = uma_zalloc(sigpvc_vc_zone, M_WAITOK | M_ZERO);
if (vcp == NULL) {
*errp = ENOMEM;
return (CALL_FAILED);
OpenPOWER on IntegriCloud