summaryrefslogtreecommitdiffstats
path: root/sys/kern/kern_mbuf.c
diff options
context:
space:
mode:
authorrwatson <rwatson@FreeBSD.org>2005-07-17 14:04:03 +0000
committerrwatson <rwatson@FreeBSD.org>2005-07-17 14:04:03 +0000
commit38dffb25ed020bf3bd3136f835904c8618803952 (patch)
tree9aa25437d2359619ec3fd7047a6c85ef26da0e20 /sys/kern/kern_mbuf.c
parent82bb8e24de2d0f1c63aa8925bf17958bdbdf2153 (diff)
downloadFreeBSD-src-38dffb25ed020bf3bd3136f835904c8618803952.zip
FreeBSD-src-38dffb25ed020bf3bd3136f835904c8618803952.tar.gz
Define four constants, MBUF_{,MEM,CLUSTER,PACKET,TAG}_MEM_NAME, which
are string names for their respective UMA zones and malloc types, and are passed into uma_zcreate() and MALLOC_DEFINE(). Export them outside of _KERNEL in mbuf.h so that netstat can reference them. Change the names to improve consistency, with each zone/type associated with the mbuf allocator being prefixed mbuf_. MFC after: 1 week
Diffstat (limited to 'sys/kern/kern_mbuf.c')
-rw-r--r--sys/kern/kern_mbuf.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/sys/kern/kern_mbuf.c b/sys/kern/kern_mbuf.c
index b6b75c1..1ea6274 100644
--- a/sys/kern/kern_mbuf.c
+++ b/sys/kern/kern_mbuf.c
@@ -135,13 +135,15 @@ mbuf_init(void *dummy)
/*
* Configure UMA zones for Mbufs, Clusters, and Packets.
*/
- zone_mbuf = uma_zcreate("Mbuf", MSIZE, mb_ctor_mbuf, mb_dtor_mbuf,
+ zone_mbuf = uma_zcreate(MBUF_MEM_NAME, MSIZE, mb_ctor_mbuf,
+ mb_dtor_mbuf,
#ifdef INVARIANTS
trash_init, trash_fini, MSIZE - 1, UMA_ZONE_MAXBUCKET);
#else
NULL, NULL, MSIZE - 1, UMA_ZONE_MAXBUCKET);
#endif
- zone_clust = uma_zcreate("MbufClust", MCLBYTES, mb_ctor_clust,
+ zone_clust = uma_zcreate(MBUF_CLUSTER_MEM_NAME, MCLBYTES,
+ mb_ctor_clust,
#ifdef INVARIANTS
mb_dtor_clust, trash_init, trash_fini, UMA_ALIGN_PTR, UMA_ZONE_REFCNT);
#else
@@ -149,8 +151,8 @@ mbuf_init(void *dummy)
#endif
if (nmbclusters > 0)
uma_zone_set_max(zone_clust, nmbclusters);
- zone_pack = uma_zsecond_create("Packet", mb_ctor_pack, mb_dtor_pack,
- mb_init_pack, mb_fini_pack, zone_mbuf);
+ zone_pack = uma_zsecond_create(MBUF_PACKET_MEM_NAME, mb_ctor_pack,
+ mb_dtor_pack, mb_init_pack, mb_fini_pack, zone_mbuf);
/* uma_prealloc() goes here */
OpenPOWER on IntegriCloud