MCPcopy Create free account
hub / github.com/F-Stack/f-stack / mb_ctor_pack

Function mb_ctor_pack

freebsd/kern/kern_mbuf.c:777–802  ·  view source on GitHub ↗

* The "packet" keg constructor. */

Source from the content-addressed store, hash-verified

775 * The "packet" keg constructor.
776 */
777static int
778mb_ctor_pack(void *mem, int size, void *arg, int how)
779{
780 struct mbuf *m;
781 struct mb_args *args;
782 int error, flags;
783 short type;
784
785 m = (struct mbuf *)mem;
786 args = (struct mb_args *)arg;
787 flags = args->flags;
788 type = args->type;
789 MPASS((flags & M_NOFREE) == 0);
790
791#ifdef INVARIANTS
792 trash_ctor(m->m_ext.ext_buf, MCLBYTES, arg, how);
793#endif
794
795 error = m_init(m, how, type, flags);
796
797 /* m_ext is already initialized. */
798 m->m_data = m->m_ext.ext_buf;
799 m->m_flags = (flags | M_EXT);
800
801 return (error);
802}
803
804/*
805 * This is the protocol drain routine. Called by UMA whenever any of the

Callers

nothing calls this directly

Calls 2

trash_ctorFunction · 0.85
m_initFunction · 0.50

Tested by

no test coverage detected