m_tag_init() unused
Gleb Smirnoff
glebius at cell.sick.ru
Tue May 18 06:08:27 PDT 2004
Dear sirs,
browsing mbuf code I have found, that m_tag_init() is never used within
the source tree. I have also noted, that there is m_tag_setup() with the
following comment:
* XXX probably should be called m_tag_init; but that was
* already taken.
Attached patches remove m_tag_init(), rename m_tag_setup() to
m_tag_init(), and fix the only call to m_tag_setup().
I've tested them by rebuilding kernel and performing some network activity
on divert socket.
--
Totus tuus, Glebius.
GLEBIUS-RIPN GLEB-RIPE
-------------- next part --------------
Index: mbuf.h
===================================================================
RCS file: /home/ncvs/src/sys/sys/mbuf.h,v
retrieving revision 1.143
diff -u -r1.143 mbuf.h
--- mbuf.h 2 May 2004 15:10:17 -0000 1.143
+++ mbuf.h 18 May 2004 12:00:31 -0000
@@ -564,23 +564,11 @@
void m_tag_delete_nonpersistent(struct mbuf *);
/*
- * Initialize the list of tags associated with an mbuf.
- */
-static __inline void
-m_tag_init(struct mbuf *m)
-{
- SLIST_INIT(&m->m_pkthdr.tags);
-}
-
-/*
* Setup the contents of a tag. Note that this does not
* fillin the free method; the caller is expected to do that.
- *
- * XXX probably should be called m_tag_init; but that was
- * already taken.
*/
static __inline void
-m_tag_setup(struct m_tag *t, u_int32_t cookie, int type, int len)
+m_tag_init(struct m_tag *t, u_int32_t cookie, int type, int len)
{
t->m_tag_id = type;
t->m_tag_len = len;
-------------- next part --------------
Index: uipc_mbuf2.c
===================================================================
RCS file: /home/ncvs/src/sys/kern/uipc_mbuf2.c,v
retrieving revision 1.24
diff -u -r1.24 uipc_mbuf2.c
--- uipc_mbuf2.c 9 May 2004 05:57:58 -0000 1.24
+++ uipc_mbuf2.c 18 May 2004 12:00:06 -0000
@@ -329,7 +329,7 @@
t = malloc(len + sizeof(struct m_tag), M_PACKET_TAGS, wait);
if (t == NULL)
return NULL;
- m_tag_setup(t, cookie, type, len);
+ m_tag_init(t, cookie, type, len);
t->m_tag_free = _m_tag_free;
return t;
}
More information about the freebsd-current
mailing list