diff options
author | Jeff Roberson <jeff@FreeBSD.org> | 2002-03-20 05:48:55 +0000 |
---|---|---|
committer | Jeff Roberson <jeff@FreeBSD.org> | 2002-03-20 05:48:55 +0000 |
commit | 69c2d429c13b29b1cb66d1990d969d1314f5960f (patch) | |
tree | 98de9110564f1f77eb5a36056b5243f528e87004 /sys/netinet | |
parent | 586c8b6b29fed9a5e82b424be7c2f7249e0d69e0 (diff) | |
download | src-69c2d429c13b29b1cb66d1990d969d1314f5960f.tar.gz src-69c2d429c13b29b1cb66d1990d969d1314f5960f.zip |
Switch vm_zone.h with uma.h. Change over to uma interfaces.
Notes
Notes:
svn path=/head/; revision=92760
Diffstat (limited to 'sys/netinet')
-rw-r--r-- | sys/netinet/in_pcb.c | 8 | ||||
-rw-r--r-- | sys/netinet/in_pcb.h | 10 | ||||
-rw-r--r-- | sys/netinet/ip_divert.c | 7 | ||||
-rw-r--r-- | sys/netinet/raw_ip.c | 7 | ||||
-rw-r--r-- | sys/netinet/tcp_subr.c | 7 | ||||
-rw-r--r-- | sys/netinet/tcp_syncache.c | 17 | ||||
-rw-r--r-- | sys/netinet/tcp_timewait.c | 7 | ||||
-rw-r--r-- | sys/netinet/udp_usrreq.c | 7 |
8 files changed, 35 insertions, 35 deletions
diff --git a/sys/netinet/in_pcb.c b/sys/netinet/in_pcb.c index ff124bc248a9..c7e4ecbe2ee9 100644 --- a/sys/netinet/in_pcb.c +++ b/sys/netinet/in_pcb.c @@ -52,7 +52,7 @@ #include <machine/limits.h> -#include <vm/vm_zone.h> +#include <vm/uma.h> #include <net/if.h> #include <net/if_types.h> @@ -144,7 +144,7 @@ in_pcballoc(so, pcbinfo, td) int error; #endif - inp = zalloc(pcbinfo->ipi_zone); + inp = uma_zalloc(pcbinfo->ipi_zone, M_WAITOK); if (inp == NULL) return (ENOBUFS); bzero((caddr_t)inp, sizeof(*inp)); @@ -154,7 +154,7 @@ in_pcballoc(so, pcbinfo, td) #ifdef IPSEC error = ipsec_init_policy(so, &inp->inp_sp); if (error != 0) { - zfree(pcbinfo->ipi_zone, inp); + uma_zfree(pcbinfo->ipi_zone, inp); return error; } #endif /*IPSEC*/ @@ -573,7 +573,7 @@ in_pcbdetach(inp) rtfree(inp->inp_route.ro_rt); ip_freemoptions(inp->inp_moptions); inp->inp_vflag = 0; - zfree(ipi->ipi_zone, inp); + uma_zfree(ipi->ipi_zone, inp); } /* diff --git a/sys/netinet/in_pcb.h b/sys/netinet/in_pcb.h index 92a9a2210f91..36aaa079df9f 100644 --- a/sys/netinet/in_pcb.h +++ b/sys/netinet/in_pcb.h @@ -41,7 +41,7 @@ #include <net/route.h> #include <netinet6/ipsec.h> /* for IPSEC */ -#include <vm/vm_zone.h> +#include <vm/uma.h> #define in6pcb inpcb /* for KAME src sync over BSD*'s */ #define in6p_sp inp_sp /* for KAME src sync over BSD*'s */ @@ -119,12 +119,6 @@ struct in_conninfo { #define inc6_laddr inc_ie.ie6_laddr #define inc6_route inc_dependroute.inc6_route -/* - * NB: the zone allocator is type-stable EXCEPT FOR THE FIRST TWO LONGS - * of the structure. Therefore, it is important that the members in - * that position not contain any information which is required to be - * stable. - */ struct icmp6_filter; struct inpcb { @@ -242,7 +236,7 @@ struct inpcbinfo { /* XXX documentation, prefixes */ u_short lastport; u_short lastlow; u_short lasthi; - vm_zone_t ipi_zone; /* zone to allocate pcbs from */ + uma_zone_t ipi_zone; /* zone to allocate pcbs from */ u_int ipi_count; /* number of pcbs in this list */ u_quad_t ipi_gencnt; /* current generation count */ }; diff --git a/sys/netinet/ip_divert.c b/sys/netinet/ip_divert.c index 2fa823f627f9..25a532969ceb 100644 --- a/sys/netinet/ip_divert.c +++ b/sys/netinet/ip_divert.c @@ -53,7 +53,7 @@ #include <sys/sysctl.h> #include <sys/systm.h> -#include <vm/vm_zone.h> +#include <vm/uma.h> #include <net/if.h> #include <net/route.h> @@ -120,8 +120,9 @@ div_init(void) */ divcbinfo.hashbase = hashinit(1, M_PCB, &divcbinfo.hashmask); divcbinfo.porthashbase = hashinit(1, M_PCB, &divcbinfo.porthashmask); - divcbinfo.ipi_zone = zinit("divcb", sizeof(struct inpcb), - maxsockets, ZONE_INTERRUPT, 0); + divcbinfo.ipi_zone = uma_zcreate("divcb", sizeof(struct inpcb), + NULL, NULL, NULL, NULL, UMA_ALIGN_PTR, UMA_ZONE_NOFREE); + uma_zone_set_max(divcbinfo.ipi_zone, maxsockets); } /* diff --git a/sys/netinet/raw_ip.c b/sys/netinet/raw_ip.c index 709a919190f7..1f533e184d65 100644 --- a/sys/netinet/raw_ip.c +++ b/sys/netinet/raw_ip.c @@ -49,7 +49,7 @@ #include <sys/socketvar.h> #include <sys/sysctl.h> -#include <vm/vm_zone.h> +#include <vm/uma.h> #include <net/if.h> #include <net/route.h> @@ -102,8 +102,9 @@ rip_init() */ ripcbinfo.hashbase = hashinit(1, M_PCB, &ripcbinfo.hashmask); ripcbinfo.porthashbase = hashinit(1, M_PCB, &ripcbinfo.porthashmask); - ripcbinfo.ipi_zone = zinit("ripcb", sizeof(struct inpcb), - maxsockets, ZONE_INTERRUPT, 0); + ripcbinfo.ipi_zone = uma_zcreate("ripcb", sizeof(struct inpcb), + NULL, NULL, NULL, NULL, UMA_ALIGN_PTR, UMA_ZONE_NOFREE); + uma_zone_set_max(ripcbinfo.ipi_zone, maxsockets); } static struct sockaddr_in ripsrc = { sizeof(ripsrc), AF_INET }; diff --git a/sys/netinet/tcp_subr.c b/sys/netinet/tcp_subr.c index cec858c3226e..fb71ac777890 100644 --- a/sys/netinet/tcp_subr.c +++ b/sys/netinet/tcp_subr.c @@ -55,7 +55,7 @@ #include <sys/protosw.h> #include <sys/random.h> -#include <vm/vm_zone.h> +#include <vm/uma.h> #include <net/route.h> #include <net/if.h> @@ -212,8 +212,9 @@ tcp_init() tcbinfo.hashbase = hashinit(hashsize, M_PCB, &tcbinfo.hashmask); tcbinfo.porthashbase = hashinit(hashsize, M_PCB, &tcbinfo.porthashmask); - tcbinfo.ipi_zone = zinit("tcpcb", sizeof(struct inp_tp), maxsockets, - ZONE_INTERRUPT, 0); + tcbinfo.ipi_zone = uma_zcreate("tcpcb", sizeof(struct inp_tp), + NULL, NULL, NULL, NULL, UMA_ALIGN_PTR, UMA_ZONE_NOFREE); + uma_zone_set_max(tcbinfo.ipi_zone, maxsockets); #ifdef INET6 #define TCP_MINPROTOHDR (sizeof(struct ip6_hdr) + sizeof(struct tcphdr)) #else /* INET6 */ diff --git a/sys/netinet/tcp_syncache.c b/sys/netinet/tcp_syncache.c index 3459fa13803d..054586c6d8de 100644 --- a/sys/netinet/tcp_syncache.c +++ b/sys/netinet/tcp_syncache.c @@ -83,7 +83,7 @@ #endif /*IPSEC*/ #include <machine/in_cksum.h> -#include <vm/vm_zone.h> +#include <vm/uma.h> static int tcp_syncookies = 1; SYSCTL_INT(_net_inet_tcp, OID_AUTO, syncookies, CTLFLAG_RW, @@ -114,7 +114,7 @@ static struct syncache *syncookie_lookup(struct in_conninfo *, struct tcp_syncache { struct syncache_head *hashbase; - vm_zone_t zone; + uma_zone_t zone; u_int hashsize; u_int hashmask; u_int bucket_limit; @@ -204,7 +204,7 @@ syncache_free(struct syncache *sc) rt->rt_flags, NULL); RTFREE(rt); } - zfree(tcp_syncache.zone, sc); + uma_zfree(tcp_syncache.zone, sc); } void @@ -256,8 +256,9 @@ syncache_init(void) * older one. */ tcp_syncache.cache_limit -= 1; - tcp_syncache.zone = zinit("syncache", sizeof(struct syncache), - tcp_syncache.cache_limit, ZONE_INTERRUPT, 0); + tcp_syncache.zone = uma_zcreate("syncache", sizeof(struct syncache), + NULL, NULL, NULL, NULL, UMA_ALIGN_PTR, UMA_ZONE_NOFREE); + uma_zone_set_max(tcp_syncache.zone, tcp_syncache.cache_limit); } static void @@ -858,7 +859,7 @@ syncache_add(inc, to, th, sop, m) return (1); } - sc = zalloc(tcp_syncache.zone); + sc = uma_zalloc(tcp_syncache.zone, M_NOWAIT); if (sc == NULL) { /* * The zone allocator couldn't provide more entries. @@ -875,7 +876,7 @@ syncache_add(inc, to, th, sop, m) syncache_drop(sc, NULL); splx(s); tcpstat.tcps_sc_zonefail++; - sc = zalloc(tcp_syncache.zone); + sc = uma_zalloc(tcp_syncache.zone, M_NOWAIT); if (sc == NULL) { if (ipopts) (void) m_free(ipopts); @@ -1313,7 +1314,7 @@ syncookie_lookup(inc, th, so) return (NULL); data = data >> SYNCOOKIE_WNDBITS; - sc = zalloc(tcp_syncache.zone); + sc = uma_zalloc(tcp_syncache.zone, M_NOWAIT); if (sc == NULL) return (NULL); /* diff --git a/sys/netinet/tcp_timewait.c b/sys/netinet/tcp_timewait.c index cec858c3226e..fb71ac777890 100644 --- a/sys/netinet/tcp_timewait.c +++ b/sys/netinet/tcp_timewait.c @@ -55,7 +55,7 @@ #include <sys/protosw.h> #include <sys/random.h> -#include <vm/vm_zone.h> +#include <vm/uma.h> #include <net/route.h> #include <net/if.h> @@ -212,8 +212,9 @@ tcp_init() tcbinfo.hashbase = hashinit(hashsize, M_PCB, &tcbinfo.hashmask); tcbinfo.porthashbase = hashinit(hashsize, M_PCB, &tcbinfo.porthashmask); - tcbinfo.ipi_zone = zinit("tcpcb", sizeof(struct inp_tp), maxsockets, - ZONE_INTERRUPT, 0); + tcbinfo.ipi_zone = uma_zcreate("tcpcb", sizeof(struct inp_tp), + NULL, NULL, NULL, NULL, UMA_ALIGN_PTR, UMA_ZONE_NOFREE); + uma_zone_set_max(tcbinfo.ipi_zone, maxsockets); #ifdef INET6 #define TCP_MINPROTOHDR (sizeof(struct ip6_hdr) + sizeof(struct tcphdr)) #else /* INET6 */ diff --git a/sys/netinet/udp_usrreq.c b/sys/netinet/udp_usrreq.c index e4f7e0d73a76..4426aa9433eb 100644 --- a/sys/netinet/udp_usrreq.c +++ b/sys/netinet/udp_usrreq.c @@ -51,7 +51,7 @@ #include <sys/syslog.h> #include <sys/jail.h> -#include <vm/vm_zone.h> +#include <vm/uma.h> #include <net/if.h> #include <net/route.h> @@ -144,8 +144,9 @@ udp_init() udbinfo.hashbase = hashinit(UDBHASHSIZE, M_PCB, &udbinfo.hashmask); udbinfo.porthashbase = hashinit(UDBHASHSIZE, M_PCB, &udbinfo.porthashmask); - udbinfo.ipi_zone = zinit("udpcb", sizeof(struct inpcb), maxsockets, - ZONE_INTERRUPT, 0); + udbinfo.ipi_zone = uma_zcreate("udpcb", sizeof(struct inpcb), NULL, + NULL, NULL, NULL, UMA_ALIGN_PTR, UMA_ZONE_NOFREE); + uma_zone_set_max(udbinfo.ipi_zone, maxsockets); } void |