summaryrefslogtreecommitdiffstats
path: root/sys/netatm/uni/unisig_vc_state.c
diff options
context:
space:
mode:
authorarr <arr@FreeBSD.org>2002-06-13 14:32:51 +0000
committerarr <arr@FreeBSD.org>2002-06-13 14:32:51 +0000
commit14714108891719cd4af97afba8c20ed7b9f5a0f4 (patch)
treed4d37a64db8643744bf8333ce20f45640c1bcaef /sys/netatm/uni/unisig_vc_state.c
parent2f568aeb91d6d5f3b370b9b641b5a64a3466d1bd (diff)
downloadFreeBSD-src-14714108891719cd4af97afba8c20ed7b9f5a0f4.zip
FreeBSD-src-14714108891719cd4af97afba8c20ed7b9f5a0f4.tar.gz
- Finish the uni part of the storage pool cleanup. There should now only
be a few bits left to clean from the HARP code in terms of what is using the storage pools; once that's done, the memory management code can be removed entirely. This commit effectively changes the use of dynamic memory routines from atm_allocate, atm_free, atm_release_pool to uma_zcreate, uma_zalloc, uma_zfree, uma_zdestroy.
Diffstat (limited to 'sys/netatm/uni/unisig_vc_state.c')
-rw-r--r--sys/netatm/uni/unisig_vc_state.c42
1 files changed, 20 insertions, 22 deletions
diff --git a/sys/netatm/uni/unisig_vc_state.c b/sys/netatm/uni/unisig_vc_state.c
index fa9c3dd..3c88cba 100644
--- a/sys/netatm/uni/unisig_vc_state.c
+++ b/sys/netatm/uni/unisig_vc_state.c
@@ -456,9 +456,9 @@ unisig_vc_act04(usp, uvp, msg)
vpi = msg->msg_ie_cnid->ie_cnid_vpci;
vci = msg->msg_ie_cnid->ie_cnid_vci;
} else {
- iep = (struct ie_generic *)atm_allocate(&unisig_iepool);
- if (!iep)
- return(ENOMEM);
+ iep = uma_zalloc(unisig_ie_zone, M_WAITOK);
+ if (iep == NULL)
+ return (ENOMEM);
iep->ie_ident = UNI_IE_CNID;
iep->ie_err_cause = UNI_IE_CAUS_MISSING;
MSG_IE_ADD(msg, iep, UNI_MSG_IE_ERR);
@@ -548,12 +548,12 @@ unisig_vc_act05(usp, uvp, msg)
/*
* Send a RELEASE message
*/
- rls_msg = (struct unisig_msg *) atm_allocate(&unisig_msgpool);
+ rls_msg = uma_zalloc(unisig_msg_zone, M_WAITOK | M_ZERO);
if (rls_msg == NULL)
return(ENOMEM);
- cause_ie = (struct ie_generic *) atm_allocate(&unisig_iepool);
+ cause_ie = uma_zalloc(unisig_ie_zone, M_WAITOK | M_ZERO);
if (cause_ie == NULL) {
- atm_free(rls_msg);
+ uma_zfree(unisig_msg_zone, rls_msg);
return(ENOMEM);
}
@@ -668,9 +668,8 @@ unisig_vc_act06(usp, uvp, msg)
* No--VCI must have been specified earlier
*/
if (!uvp->uv_vci) {
- iep = (struct ie_generic *)atm_allocate(
- &unisig_iepool);
- if (!iep)
+ iep = uma_zalloc(unisig_ie_zone, M_WAITOK);
+ if (iep == NULL)
return(ENOMEM);
iep->ie_ident = UNI_IE_CNID;
iep->ie_err_cause = UNI_IE_CAUS_MISSING;
@@ -743,7 +742,7 @@ unisig_vc_act06(usp, uvp, msg)
/*
* Get memory for a CONNECT ACK message
*/
- cack_msg = (struct unisig_msg *) atm_allocate(&unisig_msgpool);
+ cack_msg = uma_zalloc(unisig_msg_zone, M_WAITOK);
if (cack_msg == NULL)
return(ENOMEM);
@@ -1059,7 +1058,7 @@ unisig_vc_act09(usp, uvp, msg)
int rc;
struct unisig_msg *conn_msg;
- conn_msg = (struct unisig_msg *) atm_allocate(&unisig_msgpool);
+ conn_msg = uma_zalloc(unisig_msg_zone, M_WAITOK);
if (conn_msg == NULL)
return(ENOMEM);
@@ -1390,9 +1389,8 @@ unisig_vc_act15(usp, uvp, msg)
}
}
if (cause == UNI_IE_CAUS_MISSING) {
- iep = (struct ie_generic *)atm_allocate(
- &unisig_iepool);
- if (!iep)
+ iep = uma_zalloc(unisig_ie_zone, M_WAITOK);
+ if (iep == NULL)
return(ENOMEM);
iep->ie_ident = UNI_IE_CNID;
iep->ie_err_cause = UNI_IE_CAUS_MISSING;
@@ -1613,7 +1611,7 @@ unisig_vc_act20(usp, uvp, msg)
/*
* Get memory for a STATUS ENQUIRY message
*/
- stat_msg = (struct unisig_msg *)atm_allocate(&unisig_msgpool);
+ stat_msg = uma_zalloc(unisig_msg_zone, M_WAITOK);
if (stat_msg == NULL)
return(ENOMEM);
@@ -1759,18 +1757,18 @@ unisig_vc_act22(usp, uvp, msg)
/*
* Get memory for a STATUS message
*/
- status = (struct unisig_msg *) atm_allocate(&unisig_msgpool);
+ status = uma_zalloc(unisig_msg_zone, M_WAITOK | M_ZERO);
if (status == NULL)
return(ENOMEM);
- callst_ie = (struct ie_generic *) atm_allocate(&unisig_iepool);
+ callst_ie = uma_zalloc(unisig_ie_zone, M_WAITOK | M_ZERO);
if (callst_ie == NULL) {
- atm_free(status);
+ uma_zfree(unisig_msg_zone, status);
return(ENOMEM);
}
- cause_ie = (struct ie_generic *) atm_allocate(&unisig_iepool);
+ cause_ie = uma_zalloc(unisig_ie_zone, M_WAITOK | M_ZERO);
if (cause_ie == NULL) {
- atm_free(status);
- atm_free(callst_ie);
+ uma_zfree(unisig_msg_zone, status);
+ uma_zfree(unisig_ie_zone, callst_ie);
return(ENOMEM);
}
@@ -1861,7 +1859,7 @@ unisig_vc_act23(usp, uvp, msg)
/*
* Get memory for the ADD PARTY REJECT message
*/
- apr_msg = (struct unisig_msg *) atm_allocate(&unisig_msgpool);
+ apr_msg = uma_zalloc(unisig_msg_zone, M_WAITOK | M_ZERO);
if (apr_msg == NULL)
return(ENOMEM);
OpenPOWER on IntegriCloud