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

Function ng_package_data

lib/ff_ng_base.c:3542–3555  ·  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

3540 * This is possibly in the critical path for new data.
3541 */
3542item_p
3543ng_package_data(struct mbuf *m, int flags)
3544{
3545 item_p item;
3546
3547 if ((item = ng_alloc_item(NGQF_DATA, flags)) == NULL) {
3548 NG_FREE_M(m);
3549 return (NULL);
3550 }
3551 ITEM_DEBUG_CHECKS;
3552 item->el_flags |= NGQF_READER;
3553 NGI_M(item) = m;
3554 return (item);
3555}
3556
3557/*
3558 * Allocate a queue item and put items into it..

Callers

nothing calls this directly

Calls 1

ng_alloc_itemFunction · 0.70

Tested by

no test coverage detected