aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv4/inetpeer.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/ipv4/inetpeer.c')
-rw-r--r--net/ipv4/inetpeer.c9
1 files changed, 1 insertions, 8 deletions
diff --git a/net/ipv4/inetpeer.c b/net/ipv4/inetpeer.c
index 9d89a381f0e1..e4cba56a5349 100644
--- a/net/ipv4/inetpeer.c
+++ b/net/ipv4/inetpeer.c
@@ -391,12 +391,6 @@ static void unlink_from_pool(struct inet_peer *p, struct inet_peer_base *base,
391 call_rcu(&p->rcu, inetpeer_free_rcu); 391 call_rcu(&p->rcu, inetpeer_free_rcu);
392} 392}
393 393
394static struct inet_peer_base *family_to_base(struct net *net,
395 int family)
396{
397 return family == AF_INET ? net->ipv4.peers : net->ipv6.peers;
398}
399
400/* perform garbage collect on all items stacked during a lookup */ 394/* perform garbage collect on all items stacked during a lookup */
401static int inet_peer_gc(struct inet_peer_base *base, 395static int inet_peer_gc(struct inet_peer_base *base,
402 struct inet_peer __rcu **stack[PEER_MAXDEPTH], 396 struct inet_peer __rcu **stack[PEER_MAXDEPTH],
@@ -434,12 +428,11 @@ static int inet_peer_gc(struct inet_peer_base *base,
434 return cnt; 428 return cnt;
435} 429}
436 430
437struct inet_peer *inet_getpeer(struct net *net, 431struct inet_peer *inet_getpeer(struct inet_peer_base *base,
438 const struct inetpeer_addr *daddr, 432 const struct inetpeer_addr *daddr,
439 int create) 433 int create)
440{ 434{
441 struct inet_peer __rcu **stack[PEER_MAXDEPTH], ***stackptr; 435 struct inet_peer __rcu **stack[PEER_MAXDEPTH], ***stackptr;
442 struct inet_peer_base *base = family_to_base(net, daddr->family);
443 struct inet_peer *p; 436 struct inet_peer *p;
444 unsigned int sequence; 437 unsigned int sequence;
445 int invalidated, gccnt = 0; 438 int invalidated, gccnt = 0;