diff options
author | arr <arr@FreeBSD.org> | 2002-06-14 16:59:38 +0000 |
---|---|---|
committer | arr <arr@FreeBSD.org> | 2002-06-14 16:59:38 +0000 |
commit | ddf3317becaf1f927336e43f96f900868c8d0a80 (patch) | |
tree | f5a02eaff404955298bf324f2af9ffc25b5473bc /sys/netatm/atm_if.c | |
parent | 1fa61e7038c01fdffbb282d50c1dd03ea22c4622 (diff) | |
download | FreeBSD-src-ddf3317becaf1f927336e43f96f900868c8d0a80.zip FreeBSD-src-ddf3317becaf1f927336e43f96f900868c8d0a80.tar.gz |
- Turn the hea and hfa HARP storage pools into UMA zones and insert
the necesary uma_zcreate() and uma_zdestroy calls into module loading
handler and the device attach handling.
- Change the related HARP netatm code to use UMA zone functions when
dealing with the zones that were formerly the ATM interface (hea, hfa)
storage pools.
- Have atm_physif_freenifs() now get passed an uma_zone_t so that we can
properly free the allocated NIF's back to their zone.
This should be the last commit to remove any code that makes use of the
netatm storage pool api. I will be removing the api code within the near
future.
Reviewed by: mdodd
Diffstat (limited to 'sys/netatm/atm_if.c')
-rw-r--r-- | sys/netatm/atm_if.c | 23 |
1 files changed, 11 insertions, 12 deletions
diff --git a/sys/netatm/atm_if.c b/sys/netatm/atm_if.c index 4f1b6a9..7b8a116 100644 --- a/sys/netatm/atm_if.c +++ b/sys/netatm/atm_if.c @@ -214,14 +214,14 @@ atm_physif_deregister(cup) /* * Free all of our network interfaces */ - atm_physif_freenifs(pip); + atm_physif_freenifs(pip, cup->cu_nif_zone); /* * Free unit's vcc information */ cvp = cup->cu_vcc; while (cvp) { - atm_free(cvp); + uma_zfree(cup->cu_vcc_zone, cvp); cvp = cvp->cv_next; } cup->cu_vcc = (Cmn_vcc *)NULL; @@ -243,8 +243,9 @@ atm_physif_deregister(cup) * */ void -atm_physif_freenifs(pip) +atm_physif_freenifs(pip, zone) struct atm_pif *pip; + uma_zone_t zone; { struct atm_nif *nip = pip->pif_nif; int s = splnet(); @@ -260,8 +261,8 @@ atm_physif_freenifs(pip) /* * Clean up network i/f trails */ - atm_nif_detach ( nip ); - atm_free ((caddr_t)nip); + atm_nif_detach(nip); + uma_zfree(zone, nip); nip = nipp; } pip->pif_nif = (struct atm_nif *)NULL; @@ -271,7 +272,6 @@ atm_physif_freenifs(pip) return; } - /* * Handle physical interface ioctl's * @@ -488,20 +488,20 @@ atm_physif_ioctl(code, data, arg) /* * Free any previously allocated NIFs */ - atm_physif_freenifs(pip); + atm_physif_freenifs(pip, cup->cu_nif_zone); /* * Add list of interfaces */ for ( count = 0; count < asr->asr_nif_cnt; count++ ) { - nip = (struct atm_nif *)atm_allocate(cup->cu_nif_pool); + nip = uma_zalloc(cup->cu_nif_zone, M_WAITOK | M_ZERO); if ( nip == NULL ) { /* * Destroy any successful nifs */ - atm_physif_freenifs(pip); + atm_physif_freenifs(pip, cup->cu_nif_zone); err = ENOMEM; break; } @@ -540,12 +540,11 @@ atm_physif_ioctl(code, data, arg) break; } if ((err = atm_nif_attach(nip)) != 0) { - atm_free ( (caddr_t)nip ); - + uma_zfree(cup->cu_nif_zone, nip); /* * Destroy any successful nifs */ - atm_physif_freenifs(pip); + atm_physif_freenifs(pip, cup->cu_nif_zone); break; } /* |