Commit 55fcc7d9 authored by Chuck Lever's avatar Chuck Lever

SUNRPC: Ignore return value of ->xpo_sendto

Clean up: All callers of svc_process() ignore its return value, so
svc_process() can safely be converted to return void. Ditto for
svc_send().

The return value of ->xpo_sendto() is now used only as part of a
trace event.
Signed-off-by: default avatarChuck Lever <chuck.lever@oracle.com>
parent ae0d7770
......@@ -430,7 +430,7 @@ struct svc_serv * svc_create_pooled(struct svc_program *, unsigned int,
int (*threadfn)(void *data));
int svc_set_num_threads(struct svc_serv *, struct svc_pool *, int);
int svc_pool_stats_open(struct svc_serv *serv, struct file *file);
int svc_process(struct svc_rqst *);
void svc_process(struct svc_rqst *rqstp);
int bc_svc_process(struct svc_serv *, struct rpc_rqst *,
struct svc_rqst *);
int svc_register(const struct svc_serv *, struct net *, const int,
......
......@@ -56,7 +56,7 @@ static inline u32 svc_sock_final_rec(struct svc_sock *svsk)
*/
void svc_close_net(struct svc_serv *, struct net *);
int svc_recv(struct svc_rqst *, long);
int svc_send(struct svc_rqst *);
void svc_send(struct svc_rqst *rqstp);
void svc_drop(struct svc_rqst *);
void svc_sock_update_bufs(struct svc_serv *serv);
bool svc_alien_sock(struct net *net, int fd);
......
......@@ -1444,11 +1444,12 @@ svc_process_common(struct svc_rqst *rqstp)
goto sendit;
}
/*
* Process the RPC request.
/**
* svc_process - Execute one RPC transaction
* @rqstp: RPC transaction context
*
*/
int
svc_process(struct svc_rqst *rqstp)
void svc_process(struct svc_rqst *rqstp)
{
struct kvec *resv = &rqstp->rq_res.head[0];
__be32 *p;
......@@ -1484,7 +1485,8 @@ svc_process(struct svc_rqst *rqstp)
if (!svc_process_common(rqstp))
goto out_drop;
return svc_send(rqstp);
svc_send(rqstp);
return;
out_baddir:
svc_printk(rqstp, "bad direction 0x%08x, dropping request\n",
......@@ -1492,7 +1494,6 @@ svc_process(struct svc_rqst *rqstp)
rqstp->rq_server->sv_stats->rpcbadfmt++;
out_drop:
svc_drop(rqstp);
return 0;
}
EXPORT_SYMBOL_GPL(svc_process);
......
......@@ -909,18 +909,20 @@ void svc_drop(struct svc_rqst *rqstp)
}
EXPORT_SYMBOL_GPL(svc_drop);
/*
* Return reply to client.
/**
* svc_send - Return reply to client
* @rqstp: RPC transaction context
*
*/
int svc_send(struct svc_rqst *rqstp)
void svc_send(struct svc_rqst *rqstp)
{
struct svc_xprt *xprt;
int len = -EFAULT;
struct xdr_buf *xb;
int status;
xprt = rqstp->rq_xprt;
if (!xprt)
goto out;
return;
/* calculate over-all length */
xb = &rqstp->rq_res;
......@@ -930,15 +932,10 @@ int svc_send(struct svc_rqst *rqstp)
trace_svc_xdr_sendto(rqstp->rq_xid, xb);
trace_svc_stats_latency(rqstp);
len = xprt->xpt_ops->xpo_sendto(rqstp);
status = xprt->xpt_ops->xpo_sendto(rqstp);
trace_svc_send(rqstp, len);
trace_svc_send(rqstp, status);
svc_xprt_release(rqstp);
if (len == -ECONNREFUSED || len == -ENOTCONN || len == -EAGAIN)
len = 0;
out:
return len;
}
/*
......
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