Switch vm_zone.h with uma.h. Change over to uma interfaces.

This commit is contained in:
Jeff Roberson 2002-03-20 05:48:55 +00:00
parent 586c8b6b29
commit 69c2d429c1
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=92760
8 changed files with 35 additions and 35 deletions

View File

@ -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);
}
/*

View File

@ -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 */
};

View File

@ -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);
}
/*

View File

@ -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 };

View File

@ -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 */

View File

@ -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);
/*

View File

@ -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 */

View File

@ -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