Commit 5f2f6bd9 authored by Trond Myklebust's avatar Trond Myklebust

SUNRPC: Simplify xprt_prepare_transmit()

Remove the checks for whether or not we need to transmit, and whether
or not a reply has been received. Those are already handled in
call_transmit() itself.
Signed-off-by: default avatarTrond Myklebust <trond.myklebust@hammerspace.com>
parent 04b3b88f
...@@ -1123,27 +1123,18 @@ bool xprt_prepare_transmit(struct rpc_task *task) ...@@ -1123,27 +1123,18 @@ bool xprt_prepare_transmit(struct rpc_task *task)
{ {
struct rpc_rqst *req = task->tk_rqstp; struct rpc_rqst *req = task->tk_rqstp;
struct rpc_xprt *xprt = req->rq_xprt; struct rpc_xprt *xprt = req->rq_xprt;
bool ret = false;
dprintk("RPC: %5u xprt_prepare_transmit\n", task->tk_pid); dprintk("RPC: %5u xprt_prepare_transmit\n", task->tk_pid);
spin_lock_bh(&xprt->transport_lock); if (!xprt_lock_write(xprt, task)) {
if (!req->rq_bytes_sent) { /* Race breaker: someone may have transmitted us */
if (req->rq_reply_bytes_recvd) {
task->tk_status = req->rq_reply_bytes_recvd;
goto out_unlock;
}
if (!test_bit(RPC_TASK_NEED_XMIT, &task->tk_runstate)) if (!test_bit(RPC_TASK_NEED_XMIT, &task->tk_runstate))
goto out_unlock; rpc_wake_up_queued_task_set_status(&xprt->sending,
} task, 0);
if (!xprt->ops->reserve_xprt(xprt, task)) { return false;
task->tk_status = -EAGAIN;
goto out_unlock;
} }
ret = true; return true;
out_unlock:
spin_unlock_bh(&xprt->transport_lock);
return ret;
} }
void xprt_end_transmit(struct rpc_task *task) void xprt_end_transmit(struct rpc_task *task)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment