Date: Thu, 30 Mar 2017 02:34:21 +0000 (UTC) From: Adrian Chadd <adrian@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r316206 - head/sys/sys Message-ID: <201703300234.v2U2YLfB014888@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: adrian Date: Thu Mar 30 02:34:21 2017 New Revision: 316206 URL: https://svnweb.freebsd.org/changeset/base/316206 Log: [mbufq] add a concat method. Reviewed by: gnn, ae, glebius Approved by: ae, glebius Differential Revision: https://reviews.freebsd.org/D10158 Modified: head/sys/sys/mbuf.h Modified: head/sys/sys/mbuf.h ============================================================================== --- head/sys/sys/mbuf.h Thu Mar 30 02:32:38 2017 (r316205) +++ head/sys/sys/mbuf.h Thu Mar 30 02:34:21 2017 (r316206) @@ -1320,5 +1320,18 @@ mbufq_prepend(struct mbufq *mq, struct m STAILQ_INSERT_HEAD(&mq->mq_head, m, m_stailqpkt); mq->mq_len++; } + +/* + * Note: this doesn't enforce the maximum list size for dst. + */ +static inline void +mbufq_concat(struct mbufq *mq_dst, struct mbufq *mq_src) +{ + + mq_dst->mq_len += mq_src->mq_len; + STAILQ_CONCAT(&mq_dst->mq_head, &mq_src->mq_head); + mq_src->mq_len = 0; +} + #endif /* _KERNEL */ #endif /* !_SYS_MBUF_H_ */
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201703300234.v2U2YLfB014888>