/* release all the calls associated with a socket  */
void rxrpc_release_calls_on_socket(struct rxrpc_sock *rx)
/* release all the calls associated with a socket  */
void rxrpc_release_calls_on_socket(struct rxrpc_sock *rx)
{
	struct rxrpc_call *call;
	struct rb_node *p;
	_enter("%p", rx);
	read_lock_bh(&rx->call_lock);
	for (p = rb_first(&rx->calls); p; p = rb_next(p)) {
		call = rb_entry(p, struct rxrpc_call, sock_node);
		rxrpc_mark_call_released(call);
	}
	list_for_each_entry(call, &rx->secureq, accept_link) {
		rxrpc_mark_call_released(call);
	}
	list_for_each_entry(call, &rx->acceptq, accept_link) {
		rxrpc_mark_call_released(call);
	}
	read_unlock_bh(&rx->call_lock);
	_leave("");
}