SUNRPC: Refactor RPC call encoding

Move the call encoding so that it occurs before the transport connection
etc.

Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
This commit is contained in:
Trond Myklebust
2018-08-24 16:28:28 -04:00
parent 944b042921
commit 762e4e67b3
3 changed files with 63 additions and 41 deletions

View File

@@ -1058,18 +1058,10 @@ void xprt_request_wait_receive(struct rpc_task *task)
spin_unlock(&xprt->queue_lock);
}
static bool
xprt_request_need_transmit(struct rpc_task *task)
{
return !(task->tk_flags & RPC_TASK_NO_RETRANS_TIMEOUT) ||
xprt_request_retransmit_after_disconnect(task);
}
static bool
xprt_request_need_enqueue_transmit(struct rpc_task *task, struct rpc_rqst *req)
{
return xprt_request_need_transmit(task) &&
!test_bit(RPC_TASK_NEED_XMIT, &task->tk_runstate);
return !test_bit(RPC_TASK_NEED_XMIT, &task->tk_runstate);
}
/**
@@ -1124,6 +1116,18 @@ xprt_request_dequeue_transmit(struct rpc_task *task)
spin_unlock(&xprt->queue_lock);
}
/**
* xprt_request_need_retransmit - Test if a task needs retransmission
* @task: pointer to rpc_task
*
* Test for whether a connection breakage requires the task to retransmit
*/
bool
xprt_request_need_retransmit(struct rpc_task *task)
{
return xprt_request_retransmit_after_disconnect(task);
}
/**
* xprt_prepare_transmit - reserve the transport before sending a request
* @task: RPC task about to send a request