* 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. *
| 3540 | * This is possibly in the critical path for new data. |
| 3541 | */ |
| 3542 | item_p |
| 3543 | ng_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.. |
nothing calls this directly
no test coverage detected