FreeBSD/sys/rpc/clnt_bck.c
/*
 * This call is done by the svc code when a backchannel RPC reply is
 * received.
 */
This call is done by the svc code when a backchannel RPC reply is
received.
This call is done by the svc code when a backchannel RPC reply is received .
void
clnt_bck_svccall(void *arg, struct mbuf *mrep, uint32_t xid)
{
	struct ct_data *ct = (struct ct_data *)arg;
	struct ct_request *cr;
	int foundreq;
	mtx_lock(&ct->ct_lock);
	ct->ct_upcallrefs++;
	foundreq = 0;
	TAILQ_FOREACH(cr, &ct->ct_pending, cr_link) {
		if (cr->cr_xid == xid) {
			cr->cr_xid = 0;
			cr->cr_mrep = mrep;
			cr->cr_error = 0;
			foundreq = 1;
			wakeup(cr);
			break;
		}
	}
	ct->ct_upcallrefs--;
	if (ct->ct_upcallrefs < 0)
		panic("rpcvc svccall refcnt");
	if (ct->ct_upcallrefs == 0)
		wakeup(&ct->ct_upcallrefs);
	mtx_unlock(&ct->ct_lock);
	if (foundreq == 0)
		m_freem(mrep);
}
void clnt_bck_svccall ( void * arg , struct mbuf * mrep , uint32_t xid ) { struct ct_data * ct = ( struct ct_data * ) arg ; struct ct_request * cr ; int foundreq ; mtx_lock ( & ct -> ct_lock ) ; ct -> ct_upcallrefs ++ ; foundreq = 0 ; TAILQ_FOREACH ( cr , & ct -> ct_pending , cr_link ) { if ( cr -> cr_xid == xid ) { cr -> cr_xid = 0 ; cr -> cr_mrep = mrep ; cr -> cr_error = 0 ; foundreq = 1 ; wakeup ( cr ) ; break ; } } ct -> ct_upcallrefs -- ; if ( ct -> ct_upcallrefs < 0 ) panic ( " " ) ; if ( ct -> ct_upcallrefs == 0 ) wakeup ( & ct -> ct_upcallrefs ) ; mtx_unlock ( & ct -> ct_lock ) ; if ( foundreq == 0 ) m_freem ( mrep ) ; }
This call is done by the svc code when a backchannel RPC reply is
 received.
This call is done by the svc code when a backchannel RPC reply is received .
/*
	 * See if we can match this reply to a request.
	 */ /*
			 * This one matches. We leave the reply mbuf list in
			 * cr->cr_mrep. Set the XID to zero so that we will
			 * ignore any duplicated replies.
			 */