aboutsummaryrefslogtreecommitdiffstats
path: root/net/sunrpc
diff options
context:
space:
mode:
Diffstat (limited to 'net/sunrpc')
-rw-r--r--net/sunrpc/backchannel_rqst.c9
-rw-r--r--net/sunrpc/cache.c5
-rw-r--r--net/sunrpc/clnt.c2
-rw-r--r--net/sunrpc/svcauth_unix.c22
-rw-r--r--net/sunrpc/svcsock.c12
-rw-r--r--net/sunrpc/xdr.c12
-rw-r--r--net/sunrpc/xprt.c2
-rw-r--r--net/sunrpc/xprtsock.c3
8 files changed, 28 insertions, 39 deletions
diff --git a/net/sunrpc/backchannel_rqst.c b/net/sunrpc/backchannel_rqst.c
index 31def68a0f6..5a3d675d2f2 100644
--- a/net/sunrpc/backchannel_rqst.c
+++ b/net/sunrpc/backchannel_rqst.c
@@ -176,13 +176,14 @@ out_free:
176} 176}
177EXPORT_SYMBOL_GPL(xprt_setup_backchannel); 177EXPORT_SYMBOL_GPL(xprt_setup_backchannel);
178 178
179/* 179/**
180 * Destroys the backchannel preallocated structures. 180 * xprt_destroy_backchannel - Destroys the backchannel preallocated structures.
181 * @xprt: the transport holding the preallocated strucures
182 * @max_reqs the maximum number of preallocated structures to destroy
183 *
181 * Since these structures may have been allocated by multiple calls 184 * Since these structures may have been allocated by multiple calls
182 * to xprt_setup_backchannel, we only destroy up to the maximum number 185 * to xprt_setup_backchannel, we only destroy up to the maximum number
183 * of reqs specified by the caller. 186 * of reqs specified by the caller.
184 * @xprt: the transport holding the preallocated strucures
185 * @max_reqs the maximum number of preallocated structures to destroy
186 */ 187 */
187void xprt_destroy_backchannel(struct rpc_xprt *xprt, unsigned int max_reqs) 188void xprt_destroy_backchannel(struct rpc_xprt *xprt, unsigned int max_reqs)
188{ 189{
diff --git a/net/sunrpc/cache.c b/net/sunrpc/cache.c
index 47ad2666fdf..2afd2a84dc3 100644
--- a/net/sunrpc/cache.c
+++ b/net/sunrpc/cache.c
@@ -1349,8 +1349,11 @@ static int c_show(struct seq_file *m, void *p)
1349 if (cache_check(cd, cp, NULL)) 1349 if (cache_check(cd, cp, NULL))
1350 /* cache_check does a cache_put on failure */ 1350 /* cache_check does a cache_put on failure */
1351 seq_printf(m, "# "); 1351 seq_printf(m, "# ");
1352 else 1352 else {
1353 if (cache_is_expired(cd, cp))
1354 seq_printf(m, "# ");
1353 cache_put(cp, cd); 1355 cache_put(cp, cd);
1356 }
1354 1357
1355 return cd->cache_show(m, cd, cp); 1358 return cd->cache_show(m, cd, cp);
1356} 1359}
diff --git a/net/sunrpc/clnt.c b/net/sunrpc/clnt.c
index aaf70aa6590..b05df36692f 100644
--- a/net/sunrpc/clnt.c
+++ b/net/sunrpc/clnt.c
@@ -385,7 +385,7 @@ out_no_rpciod:
385 return ERR_PTR(err); 385 return ERR_PTR(err);
386} 386}
387 387
388/* 388/**
389 * rpc_create - create an RPC client and transport with one call 389 * rpc_create - create an RPC client and transport with one call
390 * @args: rpc_clnt create argument structure 390 * @args: rpc_clnt create argument structure
391 * 391 *
diff --git a/net/sunrpc/svcauth_unix.c b/net/sunrpc/svcauth_unix.c
index 2777fa89664..4d012920373 100644
--- a/net/sunrpc/svcauth_unix.c
+++ b/net/sunrpc/svcauth_unix.c
@@ -104,23 +104,9 @@ static void ip_map_put(struct kref *kref)
104 kfree(im); 104 kfree(im);
105} 105}
106 106
107#if IP_HASHBITS == 8 107static inline int hash_ip6(const struct in6_addr *ip)
108/* hash_long on a 64 bit machine is currently REALLY BAD for
109 * IP addresses in reverse-endian (i.e. on a little-endian machine).
110 * So use a trivial but reliable hash instead
111 */
112static inline int hash_ip(__be32 ip)
113{
114 int hash = (__force u32)ip ^ ((__force u32)ip>>16);
115 return (hash ^ (hash>>8)) & 0xff;
116}
117#endif
118static inline int hash_ip6(struct in6_addr ip)
119{ 108{
120 return (hash_ip(ip.s6_addr32[0]) ^ 109 return hash_32(ipv6_addr_hash(ip), IP_HASHBITS);
121 hash_ip(ip.s6_addr32[1]) ^
122 hash_ip(ip.s6_addr32[2]) ^
123 hash_ip(ip.s6_addr32[3]));
124} 110}
125static int ip_map_match(struct cache_head *corig, struct cache_head *cnew) 111static int ip_map_match(struct cache_head *corig, struct cache_head *cnew)
126{ 112{
@@ -301,7 +287,7 @@ static struct ip_map *__ip_map_lookup(struct cache_detail *cd, char *class,
301 ip.m_addr = *addr; 287 ip.m_addr = *addr;
302 ch = sunrpc_cache_lookup(cd, &ip.h, 288 ch = sunrpc_cache_lookup(cd, &ip.h,
303 hash_str(class, IP_HASHBITS) ^ 289 hash_str(class, IP_HASHBITS) ^
304 hash_ip6(*addr)); 290 hash_ip6(addr));
305 291
306 if (ch) 292 if (ch)
307 return container_of(ch, struct ip_map, h); 293 return container_of(ch, struct ip_map, h);
@@ -331,7 +317,7 @@ static int __ip_map_update(struct cache_detail *cd, struct ip_map *ipm,
331 ip.h.expiry_time = expiry; 317 ip.h.expiry_time = expiry;
332 ch = sunrpc_cache_update(cd, &ip.h, &ipm->h, 318 ch = sunrpc_cache_update(cd, &ip.h, &ipm->h,
333 hash_str(ipm->m_class, IP_HASHBITS) ^ 319 hash_str(ipm->m_class, IP_HASHBITS) ^
334 hash_ip6(ipm->m_addr)); 320 hash_ip6(&ipm->m_addr));
335 if (!ch) 321 if (!ch)
336 return -ENOMEM; 322 return -ENOMEM;
337 cache_put(ch, cd); 323 cache_put(ch, cd);
diff --git a/net/sunrpc/svcsock.c b/net/sunrpc/svcsock.c
index a6de09de5d2..18bc130255a 100644
--- a/net/sunrpc/svcsock.c
+++ b/net/sunrpc/svcsock.c
@@ -43,6 +43,7 @@
43#include <net/tcp_states.h> 43#include <net/tcp_states.h>
44#include <asm/uaccess.h> 44#include <asm/uaccess.h>
45#include <asm/ioctls.h> 45#include <asm/ioctls.h>
46#include <trace/events/skb.h>
46 47
47#include <linux/sunrpc/types.h> 48#include <linux/sunrpc/types.h>
48#include <linux/sunrpc/clnt.h> 49#include <linux/sunrpc/clnt.h>
@@ -619,6 +620,8 @@ static int svc_udp_recvfrom(struct svc_rqst *rqstp)
619 if (!svc_udp_get_dest_address(rqstp, cmh)) { 620 if (!svc_udp_get_dest_address(rqstp, cmh)) {
620 net_warn_ratelimited("svc: received unknown control message %d/%d; dropping RPC reply datagram\n", 621 net_warn_ratelimited("svc: received unknown control message %d/%d; dropping RPC reply datagram\n",
621 cmh->cmsg_level, cmh->cmsg_type); 622 cmh->cmsg_level, cmh->cmsg_type);
623out_free:
624 trace_kfree_skb(skb, svc_udp_recvfrom);
622 skb_free_datagram_locked(svsk->sk_sk, skb); 625 skb_free_datagram_locked(svsk->sk_sk, skb);
623 return 0; 626 return 0;
624 } 627 }
@@ -630,8 +633,7 @@ static int svc_udp_recvfrom(struct svc_rqst *rqstp)
630 if (csum_partial_copy_to_xdr(&rqstp->rq_arg, skb)) { 633 if (csum_partial_copy_to_xdr(&rqstp->rq_arg, skb)) {
631 local_bh_enable(); 634 local_bh_enable();
632 /* checksum error */ 635 /* checksum error */
633 skb_free_datagram_locked(svsk->sk_sk, skb); 636 goto out_free;
634 return 0;
635 } 637 }
636 local_bh_enable(); 638 local_bh_enable();
637 skb_free_datagram_locked(svsk->sk_sk, skb); 639 skb_free_datagram_locked(svsk->sk_sk, skb);
@@ -640,10 +642,8 @@ static int svc_udp_recvfrom(struct svc_rqst *rqstp)
640 rqstp->rq_arg.head[0].iov_base = skb->data + 642 rqstp->rq_arg.head[0].iov_base = skb->data +
641 sizeof(struct udphdr); 643 sizeof(struct udphdr);
642 rqstp->rq_arg.head[0].iov_len = len; 644 rqstp->rq_arg.head[0].iov_len = len;
643 if (skb_checksum_complete(skb)) { 645 if (skb_checksum_complete(skb))
644 skb_free_datagram_locked(svsk->sk_sk, skb); 646 goto out_free;
645 return 0;
646 }
647 rqstp->rq_xprt_ctxt = skb; 647 rqstp->rq_xprt_ctxt = skb;
648 } 648 }
649 649
diff --git a/net/sunrpc/xdr.c b/net/sunrpc/xdr.c
index d65d380571b..0afba1b4b65 100644
--- a/net/sunrpc/xdr.c
+++ b/net/sunrpc/xdr.c
@@ -152,7 +152,9 @@ EXPORT_SYMBOL_GPL(xdr_inline_pages);
152 152
153/* 153/*
154 * Helper routines for doing 'memmove' like operations on a struct xdr_buf 154 * Helper routines for doing 'memmove' like operations on a struct xdr_buf
155 * 155 */
156
157/**
156 * _shift_data_right_pages 158 * _shift_data_right_pages
157 * @pages: vector of pages containing both the source and dest memory area. 159 * @pages: vector of pages containing both the source and dest memory area.
158 * @pgto_base: page vector address of destination 160 * @pgto_base: page vector address of destination
@@ -214,7 +216,7 @@ _shift_data_right_pages(struct page **pages, size_t pgto_base,
214 } while ((len -= copy) != 0); 216 } while ((len -= copy) != 0);
215} 217}
216 218
217/* 219/**
218 * _copy_to_pages 220 * _copy_to_pages
219 * @pages: array of pages 221 * @pages: array of pages
220 * @pgbase: page vector address of destination 222 * @pgbase: page vector address of destination
@@ -258,7 +260,7 @@ _copy_to_pages(struct page **pages, size_t pgbase, const char *p, size_t len)
258 flush_dcache_page(*pgto); 260 flush_dcache_page(*pgto);
259} 261}
260 262
261/* 263/**
262 * _copy_from_pages 264 * _copy_from_pages
263 * @p: pointer to destination 265 * @p: pointer to destination
264 * @pages: array of pages 266 * @pages: array of pages
@@ -298,7 +300,7 @@ _copy_from_pages(char *p, struct page **pages, size_t pgbase, size_t len)
298} 300}
299EXPORT_SYMBOL_GPL(_copy_from_pages); 301EXPORT_SYMBOL_GPL(_copy_from_pages);
300 302
301/* 303/**
302 * xdr_shrink_bufhead 304 * xdr_shrink_bufhead
303 * @buf: xdr_buf 305 * @buf: xdr_buf
304 * @len: bytes to remove from buf->head[0] 306 * @len: bytes to remove from buf->head[0]
@@ -371,7 +373,7 @@ xdr_shrink_bufhead(struct xdr_buf *buf, size_t len)
371 buf->len = buf->buflen; 373 buf->len = buf->buflen;
372} 374}
373 375
374/* 376/**
375 * xdr_shrink_pagelen 377 * xdr_shrink_pagelen
376 * @buf: xdr_buf 378 * @buf: xdr_buf
377 * @len: bytes to remove from buf->pages 379 * @len: bytes to remove from buf->pages
diff --git a/net/sunrpc/xprt.c b/net/sunrpc/xprt.c
index 3c83035cdaa..a5a402a7d21 100644
--- a/net/sunrpc/xprt.c
+++ b/net/sunrpc/xprt.c
@@ -531,7 +531,7 @@ void xprt_set_retrans_timeout_def(struct rpc_task *task)
531} 531}
532EXPORT_SYMBOL_GPL(xprt_set_retrans_timeout_def); 532EXPORT_SYMBOL_GPL(xprt_set_retrans_timeout_def);
533 533
534/* 534/**
535 * xprt_set_retrans_timeout_rtt - set a request's retransmit timeout 535 * xprt_set_retrans_timeout_rtt - set a request's retransmit timeout
536 * @task: task whose timeout is to be set 536 * @task: task whose timeout is to be set
537 * 537 *
diff --git a/net/sunrpc/xprtsock.c b/net/sunrpc/xprtsock.c
index b88c6bf657b..926679459e7 100644
--- a/net/sunrpc/xprtsock.c
+++ b/net/sunrpc/xprtsock.c
@@ -1014,9 +1014,6 @@ static void xs_udp_data_ready(struct sock *sk, int len)
1014 1014
1015 UDPX_INC_STATS_BH(sk, UDP_MIB_INDATAGRAMS); 1015 UDPX_INC_STATS_BH(sk, UDP_MIB_INDATAGRAMS);
1016 1016
1017 /* Something worked... */
1018 dst_confirm(skb_dst(skb));
1019
1020 xprt_adjust_cwnd(task, copied); 1017 xprt_adjust_cwnd(task, copied);
1021 xprt_complete_rqst(task, copied); 1018 xprt_complete_rqst(task, copied);
1022 1019