From f847d508c90377c349a74e173a68e0c8afb1a6db Mon Sep 17 00:00:00 2001 From: andre Date: Wed, 11 Apr 2007 23:13:12 +0000 Subject: [PATCH] Add m_last() inline function. --- sys/sys/mbuf.h | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/sys/sys/mbuf.h b/sys/sys/mbuf.h index 2f19a61c7747..b9f1c185f4ae 100644 --- a/sys/sys/mbuf.h +++ b/sys/sys/mbuf.h @@ -345,6 +345,7 @@ static __inline void m_clget(struct mbuf *m, int how); static __inline void *m_cljget(struct mbuf *m, int how, int size); static __inline void m_chtype(struct mbuf *m, short new_type); void mb_free_ext(struct mbuf *); +static __inline struct mbuf *m_last(struct mbuf *m); static __inline int m_gettype(int size) @@ -579,6 +580,15 @@ m_chtype(struct mbuf *m, short new_type) m->m_type = new_type; } +static __inline struct mbuf * +m_last(struct mbuf *m) +{ + + while (m->m_next) + m = m->m_next; + return (m); +} + /* * mbuf, cluster, and external object allocation macros (for compatibility * purposes).