MFREE()

2002-02-11 Thread Ruslan Ermilov

The following files under sys/ still use MFREE():

alpha/tc/am7990.c
netatm/port.h
security/lomac/kernel_socket.c

Please fix.


Cheers,
-- 
Ruslan Ermilov  Sysadmin and DBA,
[EMAIL PROTECTED]   Sunbay Software AG,
[EMAIL PROTECTED]  FreeBSD committer,
+380.652.512.251Simferopol, Ukraine

http://www.FreeBSD.org  The Power To Serve
http://www.oracle.com   Enabling The Information Age

To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-current" in the body of the message

To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-current" in the body of the message



Re: MFREE()

2002-02-06 Thread Matthew Dillon


:The following files under sys/ still use MFREE():
:
:alpha/tc/am7990.c
:netatm/port.h
:security/lomac/kernel_socket.c
:
:Please fix.
:
:
:Cheers,
:-- 
:Ruslan Ermilov Sysadmin and DBA,

Please review the following patch.  Note that the KB_ macros in 
netatm could be further rewritten and the (one line of) code that uses
them could be cleaned up, but I only made the minimum changes necessary
to remove MFREE().  I did rewrite the tangle of code in am7990.c,
it's about an order of magnitude easier to read now.

-Matt

Index: alpha/tc/am7990.c
===
RCS file: /home/ncvs/src/sys/alpha/tc/am7990.c,v
retrieving revision 1.12
diff -u -r1.12 am7990.c
--- alpha/tc/am7990.c   14 Jun 2001 19:36:37 -  1.12
+++ alpha/tc/am7990.c   6 Feb 2002 11:24:51 -
@@ -442,19 +442,16 @@
int boff;
register struct mbuf *m;
 {
-   register struct mbuf *n;
register int len, tlen = 0;
 
-   for (; m; m = n) {
+   while (m) {
len = m->m_len;
-   if (len == 0) {
-       MFREE(m, n);
-   continue;
+   if (len != 0) {
+   (*sc->sc_copytobuf)(sc, mtod(m, caddr_t), boff, len);
+   boff += len;
+   tlen += len;
}
-   (*sc->sc_copytobuf)(sc, mtod(m, caddr_t), boff, len);
-   boff += len;
-   tlen += len;
-   MFREE(m, n);
+   m = m_free(m);
}
if (tlen < LEMINSIZE) {
(*sc->sc_zerobuf)(sc, boff, LEMINSIZE - tlen);
Index: netatm/port.h
===
RCS file: /home/ncvs/src/sys/netatm/port.h,v
retrieving revision 1.5
diff -u -r1.5 port.h
--- netatm/port.h   20 Mar 2001 10:42:48 -  1.5
+++ netatm/port.h   6 Feb 2002 11:27:06 -
@@ -274,10 +274,10 @@
(prev)->m_next = (new); \
 }
 #defineKB_UNLINKHEAD(head, next) { \
-   MFREE((head), (next));  \
+   (next) = m_free(head);  \
 }
 #defineKB_UNLINK(old, prev, next) {    \
-   MFREE((old), (next));   \
+   (next) = m_free(old);   \
(prev)->m_next = (next);\
 }
 #defineKB_ISPKT(bfr)   (((bfr)->m_flags & M_PKTHDR) != 0)
@@ -407,10 +407,10 @@
(prev)->m_next = (new); \
 }
 #defineKB_UNLINKHEAD(head, next) { \
-   MFREE((head), (next));  \
+   (next) = m_free(head);  \
 }
 #defineKB_UNLINK(old, prev, next) {\
-   MFREE((old), (next));   \
+   (next) = m_free(old);   \
(prev)->m_next = (next);\
 }
 #defineKB_ISPKT(bfr)   (0)
Index: security/lomac/kernel_socket.c
===
RCS file: /home/ncvs/src/sys/security/lomac/kernel_socket.c,v
retrieving revision 1.3
diff -u -r1.3 kernel_socket.c
--- security/lomac/kernel_socket.c  26 Dec 2001 18:31:22 -  1.3
+++ security/lomac/kernel_socket.c  6 Feb 2002 11:28:08 -
@@ -644,7 +644,7 @@
m = m->m_next;
} else {
sbfree(&so->so_rcv, m);
-   MFREE(m, so->so_rcv.sb_mb);
+   so->so_rcv.sb_mb = m_free(m);
m = so->so_rcv.sb_mb;
}
}
@@ -729,7 +729,7 @@
so->so_rcv.sb_mb = m = m->m_next;
*mp = (struct mbuf *)0;
    } else {
-   MFREE(m, so->so_rcv.sb_mb);
+   so->so_rcv.sb_mb = m_free(m);
m = so->so_rcv.sb_mb;
}
if (m)

To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-current" in the body of the message



MFREE()

2002-02-05 Thread Ruslan Ermilov

The following files under sys/ still use MFREE():

alpha/tc/am7990.c
netatm/port.h
security/lomac/kernel_socket.c

Please fix.


Cheers,
-- 
Ruslan Ermilov  Sysadmin and DBA,
[EMAIL PROTECTED]   Sunbay Software AG,
[EMAIL PROTECTED]  FreeBSD committer,
+380.652.512.251Simferopol, Ukraine

http://www.FreeBSD.org  The Power To Serve
http://www.oracle.com   Enabling The Information Age

To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-current" in the body of the message