Date: Fri, 18 Oct 2013 09:07:11 +0000 (UTC) From: Andre Oppermann <andre@FreeBSD.org> To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r256723 - in user/andre/mbuf_staging: kern netipx sys Message-ID: <201310180907.r9I97BWt027893@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: andre Date: Fri Oct 18 09:07:10 2013 New Revision: 256723 URL: http://svnweb.freebsd.org/changeset/base/256723 Log: Change the only user of the MCHTYPE macro to the m_chtype() function. Remove the MCHTYPE macro. Move the m_chtype() inline function to kern/kern_mbuf.c. Properly sort m_extadd() prototype. Modified: user/andre/mbuf_staging/kern/kern_mbuf.c user/andre/mbuf_staging/netipx/spx_reass.c user/andre/mbuf_staging/sys/mbuf.h Modified: user/andre/mbuf_staging/kern/kern_mbuf.c ============================================================================== --- user/andre/mbuf_staging/kern/kern_mbuf.c Fri Oct 18 07:48:20 2013 (r256722) +++ user/andre/mbuf_staging/kern/kern_mbuf.c Fri Oct 18 09:07:10 2013 (r256723) @@ -998,6 +998,13 @@ m_getm2(struct mbuf *m, int len, int how return (m); } +void +m_chtype(struct mbuf *m, short new_type) +{ + + m->m_type = new_type; +} + struct mbuf * m_free(struct mbuf *m) { Modified: user/andre/mbuf_staging/netipx/spx_reass.c ============================================================================== --- user/andre/mbuf_staging/netipx/spx_reass.c Fri Oct 18 07:48:20 2013 (r256722) +++ user/andre/mbuf_staging/netipx/spx_reass.c Fri Oct 18 09:07:10 2013 (r256723) @@ -413,7 +413,7 @@ present: } } if (sp->spx_cc & SPX_OB) { - MCHTYPE(mqsi, MT_OOBDATA); + m_chtype(mqsi, MT_OOBDATA); spx_newchecks[1]++; so->so_oobmark = 0; so->so_rcv.sb_state &= ~SBS_RCVATMARK; Modified: user/andre/mbuf_staging/sys/mbuf.h ============================================================================== --- user/andre/mbuf_staging/sys/mbuf.h Fri Oct 18 07:48:20 2013 (r256722) +++ user/andre/mbuf_staging/sys/mbuf.h Fri Oct 18 09:07:10 2013 (r256723) @@ -514,21 +514,6 @@ struct mbuf *m_get2(int, int, short, int struct mbuf *m_getjcl(int, short, int, int); struct mbuf *m_getm2(struct mbuf *, int, int, short, int); - - -/* - * Change mbuf to new type. This is a relatively expensive operation and - * should be avoided. - */ -#define MCHTYPE(m, t) m_chtype((m), (t)) - -static __inline void -m_chtype(struct mbuf *m, short new_type) -{ - - m->m_type = new_type; -} - static __inline void m_clrprotoflags(struct mbuf *m) { @@ -623,9 +608,7 @@ int m_apply(struct mbuf *, int, int, int (*)(void *, void *, u_int), void *); int m_append(struct mbuf *, int, c_caddr_t); void m_cat(struct mbuf *, struct mbuf *); -int m_extadd(struct mbuf *, caddr_t, u_int, - int (*)(struct mbuf *, void *, void *), void *, void *, - int, int, int); +void m_chtype(struct mbuf *, short); struct mbuf *m_collapse(struct mbuf *, int, int); void m_copyback(struct mbuf *, int, int, c_caddr_t); void m_copydata(const struct mbuf *, int, int, caddr_t); @@ -641,6 +624,9 @@ struct mbuf *m_devget(char *, int, int, void (*)(char *, caddr_t, u_int)); struct mbuf *m_dup(struct mbuf *, int); int m_dup_pkthdr(struct mbuf *, struct mbuf *, int); +int m_extadd(struct mbuf *, caddr_t, u_int, + int (*)(struct mbuf *, void *, void *), void *, void *, + int, int, int); u_int m_fixhdr(struct mbuf *); struct mbuf *m_fragment(struct mbuf *, int, int); struct mbuf *m_getptr(struct mbuf *, int, int *);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201310180907.r9I97BWt027893>