PERFORCE change 117052 for review
Kip Macy
kmacy at FreeBSD.org
Sun Apr 1 04:43:32 UTC 2007
http://perforce.freebsd.org/chv.cgi?CH=117052
Change 117052 by kmacy at kmacy_vt-x:opentoe_init on 2007/04/01 04:43:00
mb_ctor_clust should not assume that all clusters come from the 2k cluster zone
MFP4 after: 2 weeks
Affected files ...
.. //depot/projects/opentoe/sys/kern/kern_mbuf.c#2 edit
Differences ...
==== //depot/projects/opentoe/sys/kern/kern_mbuf.c#2 (text+ko) ====
@@ -396,31 +396,36 @@
struct mbuf *m;
u_int *refcnt;
int type = 0;
-
+ uma_zone_t zone;
+
#ifdef INVARIANTS
trash_ctor(mem, size, arg, how);
#endif
+ switch (size) {
+ case MCLBYTES:
+ type = EXT_CLUSTER;
+ zone = zone_clust;
+ break;
+#if MJUMPAGESIZE != MCLBYTES
+ case MJUMPAGESIZE:
+ type = EXT_JUMBOP;
+ zone = zone_jumbop;
+ break;
+#endif
+ case MJUM9BYTES:
+ type = EXT_JUMBO9;
+ zone = zone_jumbo9;
+ break;
+ case MJUM16BYTES:
+ type = EXT_JUMBO16;
+ zone = zone_jumbo16;
+ break;
+ default:
+ panic("unknown cluster size");
+ break;
+ }
m = (struct mbuf *)arg;
if (m != NULL) {
- switch (size) {
- case MCLBYTES:
- type = EXT_CLUSTER;
- break;
-#if MJUMPAGESIZE != MCLBYTES
- case MJUMPAGESIZE:
- type = EXT_JUMBOP;
- break;
-#endif
- case MJUM9BYTES:
- type = EXT_JUMBO9;
- break;
- case MJUM16BYTES:
- type = EXT_JUMBO16;
- break;
- default:
- panic("unknown cluster size");
- break;
- }
m->m_ext.ext_buf = (caddr_t)mem;
m->m_data = m->m_ext.ext_buf;
m->m_flags |= M_EXT;
@@ -428,10 +433,10 @@
m->m_ext.ext_args = NULL;
m->m_ext.ext_size = size;
m->m_ext.ext_type = type;
- m->m_ext.ref_cnt = uma_find_refcnt(zone_clust, mem);
+ m->m_ext.ref_cnt = uma_find_refcnt(zone, mem);
*m->m_ext.ref_cnt = 1;
} else {
- refcnt = uma_find_refcnt(zone_clust, mem);
+ refcnt = uma_find_refcnt(zone, mem);
*refcnt = 1;
}
return (0);
More information about the p4-projects
mailing list