| 996 | */ |
| 997 | |
| 998 | static int |
| 999 | ng_ksocket_incoming(struct socket *so, void *arg, int waitflag) |
| 1000 | { |
| 1001 | const node_p node = arg; |
| 1002 | const priv_p priv = NG_NODE_PRIVATE(node); |
| 1003 | int wait = ((waitflag & M_WAITOK) ? NG_WAITOK : 0) | NG_QUEUE; |
| 1004 | |
| 1005 | /* |
| 1006 | * Even if node is not locked, as soon as we are called, we assume |
| 1007 | * it exist and it's private area is valid. With some care we can |
| 1008 | * access it. Mark node that incoming event for it was sent to |
| 1009 | * avoid unneded queue trashing. |
| 1010 | */ |
| 1011 | if (atomic_cmpset_int(&priv->fn_sent, 0, 1) && |
| 1012 | ng_send_fn1(node, NULL, &ng_ksocket_incoming2, so, 0, wait)) { |
| 1013 | atomic_store_rel_int(&priv->fn_sent, 0); |
| 1014 | } |
| 1015 | return (SU_OK); |
| 1016 | } |
| 1017 | |
| 1018 | /* |
| 1019 | * When incoming data is appended to the socket, we get notified here. |
nothing calls this directly
no test coverage detected