lint
[unix-history] / usr / src / sys / kern / uipc_mbuf.c
index cd93676..f234bbf 100644 (file)
@@ -1,4 +1,4 @@
-/*     uipc_mbuf.c     1.35    82/06/14        */
+/*     uipc_mbuf.c     1.40    82/10/21        */
 
 #include "../h/param.h"
 #include "../h/dir.h"
 
 #include "../h/param.h"
 #include "../h/dir.h"
@@ -8,13 +8,12 @@
 #include "../h/cmap.h"
 #include "../h/map.h"
 #include "../h/mbuf.h"
 #include "../h/cmap.h"
 #include "../h/map.h"
 #include "../h/mbuf.h"
-#include "../net/in_systm.h"           /* XXX */
 #include "../h/vm.h"
 #include "../h/vm.h"
+#include "../h/kernel.h"
 
 mbinit()
 {
 
 
 mbinit()
 {
 
-COUNT(MBINIT);
        if (m_clalloc(4, MPG_MBUFS) == 0)
                goto bad;
        if (m_clalloc(32, MPG_CLUSTERS) == 0)
        if (m_clalloc(4, MPG_MBUFS) == 0)
                goto bad;
        if (m_clalloc(32, MPG_CLUSTERS) == 0)
@@ -34,10 +33,9 @@ m_clalloc(ncl, how)
        register int i;
        int s;
 
        register int i;
        int s;
 
-COUNT(M_CLALLOC);
        npg = ncl * CLSIZE;
        s = splimp();           /* careful: rmalloc isn't reentrant */
        npg = ncl * CLSIZE;
        s = splimp();           /* careful: rmalloc isn't reentrant */
-       mbx = rmalloc(mbmap, npg);
+       mbx = rmalloc(mbmap, (long)npg);
        splx(s);
        if (mbx == 0)
                return (0);
        splx(s);
        if (mbx == 0)
                return (0);
@@ -78,7 +76,6 @@ m_pgfree(addr, n)
        int n;
 {
 
        int n;
 {
 
-COUNT(M_PGFREE);
 #ifdef lint
        addr = addr; n = n;
 #endif
 #ifdef lint
        addr = addr; n = n;
 #endif
@@ -87,7 +84,6 @@ COUNT(M_PGFREE);
 m_expand()
 {
 
 m_expand()
 {
 
-COUNT(M_EXPAND);
        if (m_clalloc(1, MPG_MBUFS) == 0)
                goto steal;
        return (1);
        if (m_clalloc(1, MPG_MBUFS) == 0)
                goto steal;
        return (1);
@@ -109,7 +105,6 @@ m_get(canwait)
 {
        register struct mbuf *m;
 
 {
        register struct mbuf *m;
 
-COUNT(M_GET);
        MGET(m, canwait);
        return (m);
 }
        MGET(m, canwait);
        return (m);
 }
@@ -120,11 +115,9 @@ m_getclr(canwait)
 {
        register struct mbuf *m;
 
 {
        register struct mbuf *m;
 
-COUNT(M_GETCLR);
        m = m_get(canwait);
        if (m == 0)
                return (0);
        m = m_get(canwait);
        if (m == 0)
                return (0);
-       m->m_off = MMINOFF;
        bzero(mtod(m, caddr_t), MLEN);
        return (m);
 }
        bzero(mtod(m, caddr_t), MLEN);
        return (m);
 }
@@ -135,7 +128,6 @@ m_free(m)
 {
        register struct mbuf *n;
 
 {
        register struct mbuf *n;
 
-COUNT(M_FREE);
        MFREE(m, n);
        return (n);
 }
        MFREE(m, n);
        return (n);
 }
@@ -147,7 +139,6 @@ m_more(type)
 {
        register struct mbuf *m;
 
 {
        register struct mbuf *m;
 
-COUNT(M_MORE);
        if (!m_expand()) {
                mbstat.m_drops++;
                return (NULL);
        if (!m_expand()) {
                mbstat.m_drops++;
                return (NULL);
@@ -164,7 +155,6 @@ m_freem(m)
        register struct mbuf *n;
        register int s;
 
        register struct mbuf *n;
        register int s;
 
-COUNT(M_FREEM);
        if (m == NULL)
                return;
        s = splimp();
        if (m == NULL)
                return;
        s = splimp();
@@ -185,7 +175,6 @@ m_copy(m, off, len)
 {
        register struct mbuf *n, **np;
        struct mbuf *top, *p;
 {
        register struct mbuf *n, **np;
        struct mbuf *top, *p;
-COUNT(M_COPY);
 
        if (len == 0)
                return (0);
 
        if (len == 0)
                return (0);
@@ -216,11 +205,9 @@ COUNT(M_COPY);
                        p = mtod(m, struct mbuf *);
                        n->m_off = ((int)p - (int)n) + off;
                        mclrefcnt[mtocl(p)]++;
                        p = mtod(m, struct mbuf *);
                        n->m_off = ((int)p - (int)n) + off;
                        mclrefcnt[mtocl(p)]++;
-               } else {
-                       n->m_off = MMINOFF;
+               } else
                        bcopy(mtod(m, caddr_t)+off, mtod(n, caddr_t),
                            (unsigned)n->m_len);
                        bcopy(mtod(m, caddr_t)+off, mtod(n, caddr_t),
                            (unsigned)n->m_len);
-               }
                if (len != M_COPYALL)
                        len -= n->m_len;
                off = 0;
                if (len != M_COPYALL)
                        len -= n->m_len;
                off = 0;
@@ -259,7 +246,6 @@ m_adj(mp, len)
 {
        register struct mbuf *m, *n;
 
 {
        register struct mbuf *m, *n;
 
-COUNT(M_ADJ);
        if ((m = mp) == NULL)
                return;
        if (len >= 0) {
        if ((m = mp) == NULL)
                return;
        if (len >= 0) {
@@ -305,10 +291,9 @@ m_pullup(m0, len)
        n = m0;
        if (len > MLEN)
                goto bad;
        n = m0;
        if (len > MLEN)
                goto bad;
-       MGET(m, 0);
+       MGET(m, M_DONTWAIT);
        if (m == 0)
                goto bad;
        if (m == 0)
                goto bad;
-       m->m_off = MMINOFF;
        m->m_len = 0;
        do {
                count = MIN(MLEN - m->m_len, len);
        m->m_len = 0;
        do {
                count = MIN(MLEN - m->m_len, len);