forked from Minki/linux
SUNRPC: Clean up - convert xprt_prepare_transmit to return a bool
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
This commit is contained in:
parent
ee071eff0f
commit
90051ea774
@ -288,7 +288,7 @@ int xprt_reserve_xprt(struct rpc_xprt *xprt, struct rpc_task *task);
|
|||||||
int xprt_reserve_xprt_cong(struct rpc_xprt *xprt, struct rpc_task *task);
|
int xprt_reserve_xprt_cong(struct rpc_xprt *xprt, struct rpc_task *task);
|
||||||
void xprt_alloc_slot(struct rpc_xprt *xprt, struct rpc_task *task);
|
void xprt_alloc_slot(struct rpc_xprt *xprt, struct rpc_task *task);
|
||||||
void xprt_lock_and_alloc_slot(struct rpc_xprt *xprt, struct rpc_task *task);
|
void xprt_lock_and_alloc_slot(struct rpc_xprt *xprt, struct rpc_task *task);
|
||||||
int xprt_prepare_transmit(struct rpc_task *task);
|
bool xprt_prepare_transmit(struct rpc_task *task);
|
||||||
void xprt_transmit(struct rpc_task *task);
|
void xprt_transmit(struct rpc_task *task);
|
||||||
void xprt_end_transmit(struct rpc_task *task);
|
void xprt_end_transmit(struct rpc_task *task);
|
||||||
int xprt_adjust_timeout(struct rpc_rqst *req);
|
int xprt_adjust_timeout(struct rpc_rqst *req);
|
||||||
|
@ -1722,8 +1722,7 @@ call_transmit(struct rpc_task *task)
|
|||||||
task->tk_action = call_status;
|
task->tk_action = call_status;
|
||||||
if (task->tk_status < 0)
|
if (task->tk_status < 0)
|
||||||
return;
|
return;
|
||||||
task->tk_status = xprt_prepare_transmit(task);
|
if (!xprt_prepare_transmit(task))
|
||||||
if (task->tk_status != 0)
|
|
||||||
return;
|
return;
|
||||||
task->tk_action = call_transmit_status;
|
task->tk_action = call_transmit_status;
|
||||||
/* Encode here so that rpcsec_gss can use correct sequence number. */
|
/* Encode here so that rpcsec_gss can use correct sequence number. */
|
||||||
@ -1811,8 +1810,7 @@ call_bc_transmit(struct rpc_task *task)
|
|||||||
{
|
{
|
||||||
struct rpc_rqst *req = task->tk_rqstp;
|
struct rpc_rqst *req = task->tk_rqstp;
|
||||||
|
|
||||||
task->tk_status = xprt_prepare_transmit(task);
|
if (!xprt_prepare_transmit(task)) {
|
||||||
if (task->tk_status == -EAGAIN) {
|
|
||||||
/*
|
/*
|
||||||
* Could not reserve the transport. Try again after the
|
* Could not reserve the transport. Try again after the
|
||||||
* transport is released.
|
* transport is released.
|
||||||
|
@ -864,24 +864,27 @@ static inline int xprt_has_timer(struct rpc_xprt *xprt)
|
|||||||
* @task: RPC task about to send a request
|
* @task: RPC task about to send a request
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
int xprt_prepare_transmit(struct rpc_task *task)
|
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;
|
||||||
int err = 0;
|
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);
|
spin_lock_bh(&xprt->transport_lock);
|
||||||
if (req->rq_reply_bytes_recvd && !req->rq_bytes_sent) {
|
if (req->rq_reply_bytes_recvd && !req->rq_bytes_sent) {
|
||||||
err = req->rq_reply_bytes_recvd;
|
task->tk_status = req->rq_reply_bytes_recvd;
|
||||||
goto out_unlock;
|
goto out_unlock;
|
||||||
}
|
}
|
||||||
if (!xprt->ops->reserve_xprt(xprt, task))
|
if (!xprt->ops->reserve_xprt(xprt, task)) {
|
||||||
err = -EAGAIN;
|
task->tk_status = -EAGAIN;
|
||||||
|
goto out_unlock;
|
||||||
|
}
|
||||||
|
ret = true;
|
||||||
out_unlock:
|
out_unlock:
|
||||||
spin_unlock_bh(&xprt->transport_lock);
|
spin_unlock_bh(&xprt->transport_lock);
|
||||||
return err;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
void xprt_end_transmit(struct rpc_task *task)
|
void xprt_end_transmit(struct rpc_task *task)
|
||||||
|
Loading…
Reference in New Issue
Block a user