* 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. *
| 3510 | * This is possibly in the critical path for new data. |
| 3511 | */ |
| 3512 | item_p |
| 3513 | ng_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.. |
no test coverage detected