Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/sys reorganize MGET and MGETHDR slightly so MBUFLOCK onl...



details:   https://anonhg.NetBSD.org/src/rev/e56e7abf3b8b
branches:  trunk
changeset: 581072:e56e7abf3b8b
user:      dbj <dbj%NetBSD.org@localhost>
date:      Mon May 23 17:34:07 2005 +0000

description:
reorganize MGET and MGETHDR slightly so MBUFLOCK only needs to be taken once

diffstat:

 sys/sys/mbuf.h |  26 +++++++++++++-------------
 1 files changed, 13 insertions(+), 13 deletions(-)

diffs (57 lines):

diff -r 789268e2024e -r e56e7abf3b8b sys/sys/mbuf.h
--- a/sys/sys/mbuf.h    Mon May 23 16:35:26 2005 +0000
+++ b/sys/sys/mbuf.h    Mon May 23 17:34:07 2005 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: mbuf.h,v 1.106 2005/04/23 14:05:28 manu Exp $  */
+/*     $NetBSD: mbuf.h,v 1.107 2005/05/23 17:34:07 dbj Exp $   */
 
 /*-
  * Copyright (c) 1996, 1997, 1999, 2001 The NetBSD Foundation, Inc.
@@ -419,27 +419,27 @@
  * are guaranteed to return successfully.
  */
 #define        MGET(m, how, type)                                              \
-do {                                                                   \
-       MBUFLOCK((m) = pool_cache_get(&mbpool_cache,                    \
-           (how) == M_WAIT ? PR_WAITOK|PR_LIMITFAIL : 0););            \
+MBUFLOCK(                                                              \
+       (m) = pool_cache_get(&mbpool_cache,                             \
+               (how) == M_WAIT ? PR_WAITOK|PR_LIMITFAIL : 0);          \
        if (m) {                                                        \
-               MBUFLOCK(mbstat.m_mtypes[type]++;                       \
-                   _MOWNERINIT((m), (type)); );                        \
+               mbstat.m_mtypes[type]++;                                \
+               _MOWNERINIT((m), (type));                               \
                (m)->m_type = (type);                                   \
                (m)->m_next = (struct mbuf *)NULL;                      \
                (m)->m_nextpkt = (struct mbuf *)NULL;                   \
                (m)->m_data = (m)->m_dat;                               \
                (m)->m_flags = 0;                                       \
        }                                                               \
-} while (/* CONSTCOND */ 0)
+)
 
 #define        MGETHDR(m, how, type)                                           \
-do {                                                                   \
-       MBUFLOCK((m) = pool_cache_get(&mbpool_cache,                    \
-           (how) == M_WAIT ? PR_WAITOK|PR_LIMITFAIL : 0););            \
+MBUFLOCK(                                                              \
+       (m) = pool_cache_get(&mbpool_cache,                             \
+           (how) == M_WAIT ? PR_WAITOK|PR_LIMITFAIL : 0);              \
        if (m) {                                                        \
-               MBUFLOCK(mbstat.m_mtypes[type]++;                       \
-                   _MOWNERINIT((m), (type)); );                        \
+               mbstat.m_mtypes[type]++;                                \
+               _MOWNERINIT((m), (type));                               \
                (m)->m_type = (type);                                   \
                (m)->m_next = (struct mbuf *)NULL;                      \
                (m)->m_nextpkt = (struct mbuf *)NULL;                   \
@@ -450,7 +450,7 @@
                (m)->m_pkthdr.csum_data = 0;                            \
                SLIST_INIT(&(m)->m_pkthdr.tags);                        \
        }                                                               \
-} while (/* CONSTCOND */ 0)
+)
 
 #if defined(_KERNEL)
 #define        _M_



Home | Main Index | Thread Index | Old Index