Merge tag 'nfsd-4.20' of git://linux-nfs.org/~bfields/linux
[muen/linux.git] / net / sunrpc / xprtrdma / svc_rdma_backchannel.c
index 7e188bc..f3c147d 100644 (file)
@@ -53,7 +53,7 @@ int svc_rdma_handle_bc_reply(struct rpc_xprt *xprt, __be32 *rdma_resp,
        if (src->iov_len < 24)
                goto out_shortreply;
 
        if (src->iov_len < 24)
                goto out_shortreply;
 
-       spin_lock(&xprt->recv_lock);
+       spin_lock(&xprt->queue_lock);
        req = xprt_lookup_rqst(xprt, xid);
        if (!req)
                goto out_notfound;
        req = xprt_lookup_rqst(xprt, xid);
        if (!req)
                goto out_notfound;
@@ -64,7 +64,7 @@ int svc_rdma_handle_bc_reply(struct rpc_xprt *xprt, __be32 *rdma_resp,
                goto out_unlock;
        memcpy(dst->iov_base, p, len);
        xprt_pin_rqst(req);
                goto out_unlock;
        memcpy(dst->iov_base, p, len);
        xprt_pin_rqst(req);
-       spin_unlock(&xprt->recv_lock);
+       spin_unlock(&xprt->queue_lock);
 
        credits = be32_to_cpup(rdma_resp + 2);
        if (credits == 0)
 
        credits = be32_to_cpup(rdma_resp + 2);
        if (credits == 0)
@@ -76,14 +76,14 @@ int svc_rdma_handle_bc_reply(struct rpc_xprt *xprt, __be32 *rdma_resp,
        xprt->cwnd = credits << RPC_CWNDSHIFT;
        spin_unlock_bh(&xprt->transport_lock);
 
        xprt->cwnd = credits << RPC_CWNDSHIFT;
        spin_unlock_bh(&xprt->transport_lock);
 
-       spin_lock(&xprt->recv_lock);
+       spin_lock(&xprt->queue_lock);
        ret = 0;
        xprt_complete_rqst(req->rq_task, rcvbuf->len);
        xprt_unpin_rqst(req);
        rcvbuf->len = 0;
 
 out_unlock:
        ret = 0;
        xprt_complete_rqst(req->rq_task, rcvbuf->len);
        xprt_unpin_rqst(req);
        rcvbuf->len = 0;
 
 out_unlock:
-       spin_unlock(&xprt->recv_lock);
+       spin_unlock(&xprt->queue_lock);
 out:
        return ret;
 
 out:
        return ret;
 
@@ -212,9 +212,8 @@ drop_connection:
  * connection.
  */
 static int
  * connection.
  */
 static int
-xprt_rdma_bc_send_request(struct rpc_task *task)
+xprt_rdma_bc_send_request(struct rpc_rqst *rqst)
 {
 {
-       struct rpc_rqst *rqst = task->tk_rqstp;
        struct svc_xprt *sxprt = rqst->rq_xprt->bc_xprt;
        struct svcxprt_rdma *rdma;
        int ret;
        struct svc_xprt *sxprt = rqst->rq_xprt->bc_xprt;
        struct svcxprt_rdma *rdma;
        int ret;
@@ -222,12 +221,7 @@ xprt_rdma_bc_send_request(struct rpc_task *task)
        dprintk("svcrdma: sending bc call with xid: %08x\n",
                be32_to_cpu(rqst->rq_xid));
 
        dprintk("svcrdma: sending bc call with xid: %08x\n",
                be32_to_cpu(rqst->rq_xid));
 
-       if (!mutex_trylock(&sxprt->xpt_mutex)) {
-               rpc_sleep_on(&sxprt->xpt_bc_pending, task, NULL);
-               if (!mutex_trylock(&sxprt->xpt_mutex))
-                       return -EAGAIN;
-               rpc_wake_up_queued_task(&sxprt->xpt_bc_pending, task);
-       }
+       mutex_lock(&sxprt->xpt_mutex);
 
        ret = -ENOTCONN;
        rdma = container_of(sxprt, struct svcxprt_rdma, sc_xprt);
 
        ret = -ENOTCONN;
        rdma = container_of(sxprt, struct svcxprt_rdma, sc_xprt);
@@ -245,6 +239,7 @@ static void
 xprt_rdma_bc_close(struct rpc_xprt *xprt)
 {
        dprintk("svcrdma: %s: xprt %p\n", __func__, xprt);
 xprt_rdma_bc_close(struct rpc_xprt *xprt)
 {
        dprintk("svcrdma: %s: xprt %p\n", __func__, xprt);
+       xprt->cwnd = RPC_CWNDSHIFT;
 }
 
 static void
 }
 
 static void