Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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: Chuck Lever <chuck.lever@oracle.com>

+18 -20
+1 -1
include/linux/sunrpc/svc.h
··· 430 430 int (*threadfn)(void *data)); 431 431 int svc_set_num_threads(struct svc_serv *, struct svc_pool *, int); 432 432 int svc_pool_stats_open(struct svc_serv *serv, struct file *file); 433 - int svc_process(struct svc_rqst *); 433 + void svc_process(struct svc_rqst *rqstp); 434 434 int bc_svc_process(struct svc_serv *, struct rpc_rqst *, 435 435 struct svc_rqst *); 436 436 int svc_register(const struct svc_serv *, struct net *, const int,
+1 -1
include/linux/sunrpc/svcsock.h
··· 56 56 */ 57 57 void svc_close_net(struct svc_serv *, struct net *); 58 58 int svc_recv(struct svc_rqst *, long); 59 - int svc_send(struct svc_rqst *); 59 + void svc_send(struct svc_rqst *rqstp); 60 60 void svc_drop(struct svc_rqst *); 61 61 void svc_sock_update_bufs(struct svc_serv *serv); 62 62 bool svc_alien_sock(struct net *net, int fd);
+7 -6
net/sunrpc/svc.c
··· 1444 1444 goto sendit; 1445 1445 } 1446 1446 1447 - /* 1448 - * Process the RPC request. 1447 + /** 1448 + * svc_process - Execute one RPC transaction 1449 + * @rqstp: RPC transaction context 1450 + * 1449 1451 */ 1450 - int 1451 - svc_process(struct svc_rqst *rqstp) 1452 + void svc_process(struct svc_rqst *rqstp) 1452 1453 { 1453 1454 struct kvec *resv = &rqstp->rq_res.head[0]; 1454 1455 __be32 *p; ··· 1485 1484 1486 1485 if (!svc_process_common(rqstp)) 1487 1486 goto out_drop; 1488 - return svc_send(rqstp); 1487 + svc_send(rqstp); 1488 + return; 1489 1489 1490 1490 out_baddir: 1491 1491 svc_printk(rqstp, "bad direction 0x%08x, dropping request\n", ··· 1494 1492 rqstp->rq_server->sv_stats->rpcbadfmt++; 1495 1493 out_drop: 1496 1494 svc_drop(rqstp); 1497 - return 0; 1498 1495 } 1499 1496 EXPORT_SYMBOL_GPL(svc_process); 1500 1497
+9 -12
net/sunrpc/svc_xprt.c
··· 909 909 } 910 910 EXPORT_SYMBOL_GPL(svc_drop); 911 911 912 - /* 913 - * Return reply to client. 912 + /** 913 + * svc_send - Return reply to client 914 + * @rqstp: RPC transaction context 915 + * 914 916 */ 915 - int svc_send(struct svc_rqst *rqstp) 917 + void svc_send(struct svc_rqst *rqstp) 916 918 { 917 919 struct svc_xprt *xprt; 918 - int len = -EFAULT; 919 920 struct xdr_buf *xb; 921 + int status; 920 922 921 923 xprt = rqstp->rq_xprt; 922 924 if (!xprt) 923 - goto out; 925 + return; 924 926 925 927 /* calculate over-all length */ 926 928 xb = &rqstp->rq_res; ··· 932 930 trace_svc_xdr_sendto(rqstp->rq_xid, xb); 933 931 trace_svc_stats_latency(rqstp); 934 932 935 - len = xprt->xpt_ops->xpo_sendto(rqstp); 933 + status = xprt->xpt_ops->xpo_sendto(rqstp); 936 934 937 - trace_svc_send(rqstp, len); 935 + trace_svc_send(rqstp, status); 938 936 svc_xprt_release(rqstp); 939 - 940 - if (len == -ECONNREFUSED || len == -ENOTCONN || len == -EAGAIN) 941 - len = 0; 942 - out: 943 - return len; 944 937 } 945 938 946 939 /*