diff options
author | jeff <jeff@FreeBSD.org> | 2002-03-20 05:48:55 +0000 |
---|---|---|
committer | jeff <jeff@FreeBSD.org> | 2002-03-20 05:48:55 +0000 |
commit | 0a59f1223c856d6130a3ef3b5c5f27b2a6a2296f (patch) | |
tree | 98de9110564f1f77eb5a36056b5243f528e87004 /sys/netinet/tcp_syncache.c | |
parent | dcd2af765542f95ecc4d1a0842c71e1e84733af8 (diff) | |
download | FreeBSD-src-0a59f1223c856d6130a3ef3b5c5f27b2a6a2296f.zip FreeBSD-src-0a59f1223c856d6130a3ef3b5c5f27b2a6a2296f.tar.gz |
Switch vm_zone.h with uma.h. Change over to uma interfaces.
Diffstat (limited to 'sys/netinet/tcp_syncache.c')
-rw-r--r-- | sys/netinet/tcp_syncache.c | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/sys/netinet/tcp_syncache.c b/sys/netinet/tcp_syncache.c index 3459fa1..054586c 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); /* |