FreeBSD/sys/ofed/drivers/infiniband/ulp/sdp/sdp_main.c
/*
 * Perform timer based shutdowns which can not operate in
 * callout context.
 */
Perform timer based shutdowns which can not operate in
callout context.
Perform timer based shutdowns which can not operate in callout context .
static void
sdp_shutdown_task(void *data, int pending)
{
	struct sdp_sock *ssk;
	ssk = data;
	SDP_WLOCK(ssk);
	if (ssk->flags & SDP_DESTROY)
		panic("sdp_shutdown_task: Racing with pcbfree for ssk %p",
		    ssk);
	if (ssk->flags & SDP_DISCON)
		sdp_output_reset(ssk);
	ssk->flags &= ~(SDP_TIMEWAIT | SDP_DREQWAIT);
	if ((ssk->flags & SDP_DROPPED) == 0 &&
	    sdp_closed(ssk) == NULL)
		return;
	if (ssk->socket == NULL) {
		sdp_pcbfree(ssk);
		return;
	}
	SDP_WUNLOCK(ssk);
}
static void sdp_shutdown_task ( void * data , int pending ) { struct sdp_sock * ssk ; ssk = data ; SDP_WLOCK ( ssk ) ; if ( ssk -> flags & SDP_DESTROY ) panic ( " " , ssk ) ; if ( ssk -> flags & SDP_DISCON ) sdp_output_reset ( ssk ) ; ssk -> flags &= ~ ( SDP_TIMEWAIT | SDP_DREQWAIT ) ; if ( ( ssk -> flags & SDP_DROPPED ) == 0 && sdp_closed ( ssk ) == NULL ) return ; if ( ssk -> socket == NULL ) { sdp_pcbfree ( ssk ) ; return ; } SDP_WUNLOCK ( ssk ) ; }
Perform timer based shutdowns which can not operate in
 callout context.
Perform timer based shutdowns which can not operate in callout context .
/*
	 * I don't think this can race with another call to pcbfree()
	 * because SDP_TIMEWAIT protects it.  SDP_DESTROY may be redundant.
	 */ /* We have to clear this so sdp_detach() will call pcbfree(). */