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

Function m_init

freebsd/sys/mbuf.h:930–948  ·  view source on GitHub ↗

* Initialize an mbuf with linear storage. * * Inline because the consumer text overhead will be roughly the same to * initialize or call a function with this many parameters and M_PKTHDR * should go away with constant propagation for !MGETHDR. */

Source from the content-addressed store, hash-verified

928 * should go away with constant propagation for !MGETHDR.
929 */
930static __inline int
931m_init(struct mbuf *m, int how, short type, int flags)
932{
933 int error;
934
935 m->m_next = NULL;
936 m->m_nextpkt = NULL;
937 m->m_data = m->m_dat;
938 m->m_len = 0;
939 m->m_flags = flags;
940 m->m_type = type;
941 if (flags & M_PKTHDR)
942 error = m_pkthdr_init(m, how);
943 else
944 error = 0;
945
946 MBUF_PROBE5(m__init, m, how, type, flags, error);
947 return (error);
948}
949
950static __inline struct mbuf *
951m_get(int how, short type)

Callers 7

tcp_pcap_addFunction · 0.50
mb_ctor_mbufFunction · 0.50
mb_ctor_packFunction · 0.50
iflib_fl_bufs_freeFunction · 0.50
assemble_segmentsFunction · 0.50
iflib_rxd_pkt_getFunction · 0.50
pfil_fake_mbufFunction · 0.50

Calls 1

m_pkthdr_initFunction · 0.85

Tested by

no test coverage detected