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

Function mb_ctor_mbuf

freebsd/kern/kern_mbuf.c:625–651  ·  view source on GitHub ↗

* Constructor for Mbuf primary zone. * * The 'arg' pointer points to a mb_args structure which * contains call-specific information required to support the * mbuf allocation API. See mbuf.h. */

Source from the content-addressed store, hash-verified

623 * mbuf allocation API. See mbuf.h.
624 */
625static int
626mb_ctor_mbuf(void *mem, int size, void *arg, int how)
627{
628 struct mbuf *m;
629 struct mb_args *args;
630 int error;
631 int flags;
632 short type;
633
634 args = (struct mb_args *)arg;
635 type = args->type;
636
637 /*
638 * The mbuf is initialized later. The caller has the
639 * responsibility to set up any MAC labels too.
640 */
641 if (type == MT_NOINIT)
642 return (0);
643
644 m = (struct mbuf *)mem;
645 flags = args->flags;
646 MPASS((flags & M_NOFREE) == 0);
647
648 error = m_init(m, how, type, flags);
649
650 return (error);
651}
652
653/*
654 * The Mbuf primary zone destructor.

Callers

nothing calls this directly

Calls 1

m_initFunction · 0.50

Tested by

no test coverage detected