SCCS-vsn: sys/kern/uipc_mbuf.c 7.4
+#if CLBYTES < 4096
+#define NCL_INIT (4096/CLBYTES)
+#else
+#define NCL_INIT 1
+#endif
- if (m_clalloc(4096/CLBYTES, MPG_MBUFS, M_DONTWAIT) == 0)
+ if (m_clalloc(NCL_INIT, MPG_MBUFS, M_DONTWAIT) == 0)
- if (m_clalloc(4096/CLBYTES, MPG_CLUSTERS, M_DONTWAIT) == 0)
+ if (m_clalloc(NCL_INIT, MPG_CLUSTERS, M_DONTWAIT) == 0)
goto bad;
splx(s);
return;
goto bad;
splx(s);
return;
- m = cltom(mbx / CLSIZE);
+ m = cltom(mbx * NBPG / MCLBYTES);
if (memall(&Mbmap[mbx], npg, proc, CSYS) == 0) {
rmfree(mbmap, (long)npg, (long)mbx);
return (0);
if (memall(&Mbmap[mbx], npg, proc, CSYS) == 0) {
rmfree(mbmap, (long)npg, (long)mbx);
return (0);
switch (how) {
case MPG_CLUSTERS:
switch (how) {
case MPG_CLUSTERS:
+ ncl = ncl * CLBYTES / MCLBYTES;
for (i = 0; i < ncl; i++) {
m->m_off = 0;
m->m_next = mclfree;
mclfree = m;
for (i = 0; i < ncl; i++) {
m->m_off = 0;
m->m_next = mclfree;
mclfree = m;
- m += CLBYTES / sizeof (*m);
+ m += MCLBYTES / sizeof (*m);
mbstat.m_clfree++;
}
mbstat.m_clusters += ncl;
mbstat.m_clfree++;
}
mbstat.m_clusters += ncl;