A special modified version of callout_stop() */
| 3810 | |
| 3811 | /* A special modified version of callout_stop() */ |
| 3812 | int |
| 3813 | ng_uncallout(struct callout *c, node_p node) |
| 3814 | { |
| 3815 | item_p item; |
| 3816 | int rval; |
| 3817 | |
| 3818 | KASSERT(c != NULL, ("ng_uncallout: NULL callout")); |
| 3819 | KASSERT(node != NULL, ("ng_uncallout: NULL node")); |
| 3820 | |
| 3821 | rval = callout_stop(c); |
| 3822 | item = c->c_arg; |
| 3823 | /* Do an extra check */ |
| 3824 | if ((rval > 0) && (c->c_func == &ng_callout_trampoline) && |
| 3825 | (item != NULL) && (NGI_NODE(item) == node)) { |
| 3826 | /* |
| 3827 | * We successfully removed it from the queue before it ran |
| 3828 | * So now we need to unreference everything that was |
| 3829 | * given extra references. (NG_FREE_ITEM does this). |
| 3830 | */ |
| 3831 | NG_FREE_ITEM(item); |
| 3832 | } |
| 3833 | c->c_arg = NULL; |
| 3834 | |
| 3835 | /* |
| 3836 | * Callers only want to know if the callout was cancelled and |
| 3837 | * not draining or stopped. |
| 3838 | */ |
| 3839 | return (rval > 0); |
| 3840 | } |
| 3841 | |
| 3842 | /* |
| 3843 | * Set the address, if none given, give the node here. |
no outgoing calls
no test coverage detected