/* this is a little helper that is called by callers who have seen a problem with an sc and want to detach it from the nn if someone already hasn't beat them to it. if an error is given then the shutdown will be persistent and pending transmits will be canceled.  */
static void o2net_ensure_shutdown(struct o2net_node *nn, struct o2net_sock_container *sc, int err)
/* this is a little helper that is called by callers who have seen a problem with an sc and want to detach it from the nn if someone already hasn't beat them to it. if an error is given then the shutdown will be persistent and pending transmits will be canceled.  */
static void o2net_ensure_shutdown(struct o2net_node *nn, struct o2net_sock_container *sc, int err)
{
	spin_lock(&nn->nn_lock);
	if (nn->nn_sc == sc)
		o2net_set_nn_state(nn, NULL, 0, err);
	spin_unlock(&nn->nn_lock);
}