diff options
author | Angelos D. Keromytis <angelos@cvs.openbsd.org> | 2001-06-23 03:57:49 +0000 |
---|---|---|
committer | Angelos D. Keromytis <angelos@cvs.openbsd.org> | 2001-06-23 03:57:49 +0000 |
commit | 4716e10985e6638b06ea48613528e09f59ea19f7 (patch) | |
tree | 724035b5e51beae1a2f48b0654ae34ca4232155d /sys/kern | |
parent | d0f5f5e5030e7a93600b6a72d5e4324d2f7c6dbb (diff) |
Use DLIST for tags.
Diffstat (limited to 'sys/kern')
-rw-r--r-- | sys/kern/uipc_mbuf2.c | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/sys/kern/uipc_mbuf2.c b/sys/kern/uipc_mbuf2.c index 9ee8315c98a..b644d255034 100644 --- a/sys/kern/uipc_mbuf2.c +++ b/sys/kern/uipc_mbuf2.c @@ -1,4 +1,4 @@ -/* $OpenBSD: uipc_mbuf2.c,v 1.13 2001/05/27 00:38:25 angelos Exp $ */ +/* $OpenBSD: uipc_mbuf2.c,v 1.14 2001/06/23 03:57:48 angelos Exp $ */ /* $KAME: uipc_mbuf2.c,v 1.29 2001/02/14 13:42:10 itojun Exp $ */ /* $NetBSD: uipc_mbuf.c,v 1.40 1999/04/01 00:23:25 thorpej Exp $ */ @@ -300,7 +300,7 @@ m_tag_prepend(m, t) struct mbuf *m; struct m_tag *t; { - LIST_INSERT_HEAD(&m->m_pkthdr.tags, t, m_tag_link); + DLIST_INSERT_HEAD(&m->m_pkthdr.tags, t, m_tag_link); } /* Unlink a packet tag. */ @@ -309,7 +309,7 @@ m_tag_unlink(m, t) struct mbuf *m; struct m_tag *t; { - LIST_REMOVE(t, m_tag_link); + DLIST_REMOVE(&m->m_pkthdr.tags, t, m_tag_link); } /* Unlink and free a packet tag. */ @@ -333,10 +333,10 @@ m_tag_delete_chain(m, t) if (t != NULL) p = t; else - p = LIST_FIRST(&m->m_pkthdr.tags); + p = DLIST_FIRST(&m->m_pkthdr.tags); if (p == NULL) return; - while ((q = LIST_NEXT(p, m_tag_link)) != NULL) + while ((q = DLIST_NEXT(p, m_tag_link)) != NULL) m_tag_delete(m, q); m_tag_delete(m, p); } @@ -351,13 +351,13 @@ m_tag_find(m, type, t) struct m_tag *p; if (t == NULL) - p = LIST_FIRST(&m->m_pkthdr.tags); + p = DLIST_FIRST(&m->m_pkthdr.tags); else - p = LIST_NEXT(t, m_tag_link); + p = DLIST_NEXT(t, m_tag_link); while (p != NULL) { if (p->m_tag_id == type) return (p); - p = LIST_NEXT(p, m_tag_link); + p = DLIST_NEXT(p, m_tag_link); } return (NULL); } @@ -390,16 +390,16 @@ m_tag_copy_chain(to, from) struct m_tag *p, *t, *tprev = NULL; m_tag_delete_chain(to, NULL); - LIST_FOREACH(p, &from->m_pkthdr.tags, m_tag_link) { + DLIST_FOREACH(p, &from->m_pkthdr.tags, m_tag_link) { t = m_tag_copy(p); if (t == NULL) { m_tag_delete_chain(to, NULL); return (0); } if (tprev == NULL) - LIST_INSERT_HEAD(&to->m_pkthdr.tags, t, m_tag_link); + DLIST_INSERT_HEAD(&to->m_pkthdr.tags, t, m_tag_link); else { - LIST_INSERT_AFTER(tprev, t, m_tag_link); + DLIST_INSERT_AFTER(tprev, t, m_tag_link); tprev = t; } } @@ -411,7 +411,7 @@ void m_tag_init(m) struct mbuf *m; { - LIST_INIT(&m->m_pkthdr.tags); + DLIST_INIT(&m->m_pkthdr.tags); } /* Get first tag in chain. */ @@ -419,7 +419,7 @@ struct m_tag * m_tag_first(m) struct mbuf *m; { - return (LIST_FIRST(&m->m_pkthdr.tags)); + return (DLIST_FIRST(&m->m_pkthdr.tags)); } /* Get next tag in chain. */ @@ -428,5 +428,5 @@ m_tag_next(m, t) struct mbuf *m; struct m_tag *t; { - return (LIST_NEXT(t, m_tag_link)); + return (DLIST_NEXT(t, m_tag_link)); } |