void DispatchWork9P(request_data_t *req)
{
	switch (req->rtype) {
	case _9P_REQUEST:
		switch (req->r_u._9p.pconn->trans_type) {
		case _9P_TCP:
			LogDebug(COMPONENT_DISPATCH,
				 "Dispatching 9P/TCP request %p, tcpsock=%lu",
				 req, req->r_u._9p.pconn->trans_data.sockfd);
			break;

		case _9P_RDMA:
			LogDebug(COMPONENT_DISPATCH,
				 "Dispatching 9P/RDMA request %p", req);
			break;

		default:
			LogCrit(COMPONENT_DISPATCH,
				"/!\\ Implementation error, bad 9P transport type");
			return;
		}
		break;

	default:
		LogCrit(COMPONENT_DISPATCH,
			"/!\\ Implementation error, 9P Dispatch function is called for non-9P request !!!!");
		return;
	}

	/* increase connection refcount */
	atomic_inc_uint32_t(&req->r_u._9p.pconn->refcount);

	/* new-style dispatch */
	nfs_rpc_enqueue_req(req);
}
Example #2
0
int32_t
nfs_rpc_submit_call(rpc_call_t *call, uint32_t flags)
{
    int32_t code = 0;
    request_data_t *nfsreq = NULL;
    rpc_call_channel_t *chan = call->chan;

    assert(chan);

    if (flags & NFS_RPC_CALL_INLINE) {
        code = nfs_rpc_dispatch_call(call, NFS_RPC_CALL_NONE);
    }
    else {
        nfsreq = nfs_rpc_get_nfsreq(0 /* flags */);
        pthread_mutex_lock(&call->we.mtx);
        call->states = NFS_CB_CALL_QUEUED;
        nfsreq->rtype = NFS_CALL;
        nfsreq->r_u.call = call;
        nfs_rpc_enqueue_req(nfsreq);
        pthread_mutex_unlock(&call->we.mtx);
    }

    return (code);
}