/* preemptively destroy all the peer records from a transport endpoint rather than waiting for them to time out  */
void __exit rxrpc_destroy_all_peers(void)
/* preemptively destroy all the peer records from a transport endpoint rather than waiting for them to time out  */
void __exit rxrpc_destroy_all_peers(void)
{
	DECLARE_WAITQUEUE(myself,current);
	_enter("");
	if (!list_empty(&rxrpc_peers)) {
		set_current_state(TASK_UNINTERRUPTIBLE);
		add_wait_queue(&rxrpc_peer_wq, &myself);
		while (!list_empty(&rxrpc_peers)) {
			schedule();
			set_current_state(TASK_UNINTERRUPTIBLE);
		}
		remove_wait_queue(&rxrpc_peer_wq, &myself);
		set_current_state(TASK_RUNNING);
	}
	_leave("");
}