Commit 3d0f24a7 authored by Stephen Hemminger's avatar Stephen Hemminger Committed by David S. Miller

ipv6: icmp6_dst_gc return change

Change icmp6_dst_gc to return the one value the caller cares about rather
than using call by reference.
Signed-off-by: default avatarStephen Hemminger <shemminger@vyatta.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 75307c0f
...@@ -68,7 +68,7 @@ extern struct rt6_info *rt6_lookup(struct net *net, ...@@ -68,7 +68,7 @@ extern struct rt6_info *rt6_lookup(struct net *net,
extern struct dst_entry *icmp6_dst_alloc(struct net_device *dev, extern struct dst_entry *icmp6_dst_alloc(struct net_device *dev,
struct neighbour *neigh, struct neighbour *neigh,
const struct in6_addr *addr); const struct in6_addr *addr);
extern int icmp6_dst_gc(int *more); extern int icmp6_dst_gc(void);
extern void fib6_force_start_gc(struct net *net); extern void fib6_force_start_gc(struct net *net);
......
...@@ -1453,9 +1453,8 @@ void fib6_run_gc(unsigned long expires, struct net *net) ...@@ -1453,9 +1453,8 @@ void fib6_run_gc(unsigned long expires, struct net *net)
} }
gc_args.timeout = net->ipv6.sysctl.ip6_rt_gc_interval; gc_args.timeout = net->ipv6.sysctl.ip6_rt_gc_interval;
} }
gc_args.more = 0;
icmp6_dst_gc(&gc_args.more); gc_args.more = icmp6_dst_gc();
fib6_clean_all(net, fib6_age, 0, NULL); fib6_clean_all(net, fib6_age, 0, NULL);
......
...@@ -978,13 +978,12 @@ struct dst_entry *icmp6_dst_alloc(struct net_device *dev, ...@@ -978,13 +978,12 @@ struct dst_entry *icmp6_dst_alloc(struct net_device *dev,
return &rt->u.dst; return &rt->u.dst;
} }
int icmp6_dst_gc(int *more) int icmp6_dst_gc(void)
{ {
struct dst_entry *dst, *next, **pprev; struct dst_entry *dst, *next, **pprev;
int freed; int more = 0;
next = NULL; next = NULL;
freed = 0;
spin_lock_bh(&icmp6_dst_lock); spin_lock_bh(&icmp6_dst_lock);
pprev = &icmp6_dst_gc_list; pprev = &icmp6_dst_gc_list;
...@@ -993,16 +992,15 @@ int icmp6_dst_gc(int *more) ...@@ -993,16 +992,15 @@ int icmp6_dst_gc(int *more)
if (!atomic_read(&dst->__refcnt)) { if (!atomic_read(&dst->__refcnt)) {
*pprev = dst->next; *pprev = dst->next;
dst_free(dst); dst_free(dst);
freed++;
} else { } else {
pprev = &dst->next; pprev = &dst->next;
(*more)++; ++more;
} }
} }
spin_unlock_bh(&icmp6_dst_lock); spin_unlock_bh(&icmp6_dst_lock);
return freed; return more;
} }
static int ip6_dst_gc(struct dst_ops *ops) static int ip6_dst_gc(struct dst_ops *ops)
......
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