* 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. */
| 928 | * should go away with constant propagation for !MGETHDR. |
| 929 | */ |
| 930 | static __inline int |
| 931 | m_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 | |
| 950 | static __inline struct mbuf * |
| 951 | m_get(int how, short type) |
no test coverage detected