| 3783 | } |
| 3784 | |
| 3785 | int |
| 3786 | ng_callout(struct callout *c, node_p node, hook_p hook, int ticks, |
| 3787 | ng_item_fn *fn, void * arg1, int arg2) |
| 3788 | { |
| 3789 | item_p item, oitem; |
| 3790 | |
| 3791 | if ((item = ng_alloc_item(NGQF_FN, NG_NOFLAGS)) == NULL) |
| 3792 | return (ENOMEM); |
| 3793 | |
| 3794 | item->el_flags |= NGQF_WRITER; |
| 3795 | NG_NODE_REF(node); /* and one for the item */ |
| 3796 | NGI_SET_NODE(item, node); |
| 3797 | if (hook) { |
| 3798 | NG_HOOK_REF(hook); |
| 3799 | NGI_SET_HOOK(item, hook); |
| 3800 | } |
| 3801 | NGI_FN(item) = fn; |
| 3802 | NGI_ARG1(item) = arg1; |
| 3803 | NGI_ARG2(item) = arg2; |
| 3804 | oitem = c->c_arg; |
| 3805 | if (callout_reset(c, ticks, &ng_callout_trampoline, item) == 1 && |
| 3806 | oitem != NULL) |
| 3807 | NG_FREE_ITEM(oitem); |
| 3808 | return (0); |
| 3809 | } |
| 3810 | |
| 3811 | /* A special modified version of callout_stop() */ |
| 3812 | int |
no test coverage detected