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

Function ng_package_data

freebsd/netgraph/ng_base.c:3512–3525  ·  view source on GitHub ↗

* Put mbuf into the item. * Hook and node references will be removed when the item is dequeued. * (or equivalent) * (XXX) Unsafe because no reference held by peer on remote node. * remote node might go away in this timescale. * We know the hooks can't go away because that would require getting * a writer item on both nodes and we must have at least a reader * here to be able to do this. *

Source from the content-addressed store, hash-verified

3510 * This is possibly in the critical path for new data.
3511 */
3512item_p
3513ng_package_data(struct mbuf *m, int flags)
3514{
3515 item_p item;
3516
3517 if ((item = ng_alloc_item(NGQF_DATA, flags)) == NULL) {
3518 NG_FREE_M(m);
3519 return (NULL);
3520 }
3521 ITEM_DEBUG_CHECKS;
3522 item->el_flags |= NGQF_READER;
3523 NGI_M(item) = m;
3524 return (item);
3525}
3526
3527/*
3528 * Allocate a queue item and put items into it..

Callers 7

ngd_sendFunction · 0.70
ng_connect_dataFunction · 0.70
ng_ppp_frag_processFunction · 0.70
ng_ppp_frag_checkstaleFunction · 0.70
ng_ppp_mp_xmitFunction · 0.70
get_export_dgramFunction · 0.50
get_export9_dgramFunction · 0.50

Calls 1

ng_alloc_itemFunction · 0.70

Tested by

no test coverage detected