aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv6
diff options
context:
space:
mode:
authorStephen Hemminger <shemminger@vyatta.com>2008-07-22 17:35:50 -0400
committerDavid S. Miller <davem@davemloft.net>2008-07-22 17:35:50 -0400
commit3d0f24a74e7957593a5622eb5c04ed6860dd8391 (patch)
tree52c17c0606f47f5435ada93baf63d1a585a2ccb9 /net/ipv6
parent75307c0fe7fcb3b52a92fe32384fc33f50622654 (diff)
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: Stephen Hemminger <shemminger@vyatta.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv6')
-rw-r--r--net/ipv6/ip6_fib.c3
-rw-r--r--net/ipv6/route.c10
2 files changed, 5 insertions, 8 deletions
diff --git a/net/ipv6/ip6_fib.c b/net/ipv6/ip6_fib.c
index c72fd2461ca5..08ea2de28d63 100644
--- a/net/ipv6/ip6_fib.c
+++ b/net/ipv6/ip6_fib.c
@@ -1453,9 +1453,8 @@ void fib6_run_gc(unsigned long expires, struct net *net)
1453 } 1453 }
1454 gc_args.timeout = net->ipv6.sysctl.ip6_rt_gc_interval; 1454 gc_args.timeout = net->ipv6.sysctl.ip6_rt_gc_interval;
1455 } 1455 }
1456 gc_args.more = 0;
1457 1456
1458 icmp6_dst_gc(&gc_args.more); 1457 gc_args.more = icmp6_dst_gc();
1459 1458
1460 fib6_clean_all(net, fib6_age, 0, NULL); 1459 fib6_clean_all(net, fib6_age, 0, NULL);
1461 1460
diff --git a/net/ipv6/route.c b/net/ipv6/route.c
index 615b328de251..86540b24b27c 100644
--- a/net/ipv6/route.c
+++ b/net/ipv6/route.c
@@ -978,13 +978,12 @@ out:
978 return &rt->u.dst; 978 return &rt->u.dst;
979} 979}
980 980
981int icmp6_dst_gc(int *more) 981int icmp6_dst_gc(void)
982{ 982{
983 struct dst_entry *dst, *next, **pprev; 983 struct dst_entry *dst, *next, **pprev;
984 int freed; 984 int more = 0;
985 985
986 next = NULL; 986 next = NULL;
987 freed = 0;
988 987
989 spin_lock_bh(&icmp6_dst_lock); 988 spin_lock_bh(&icmp6_dst_lock);
990 pprev = &icmp6_dst_gc_list; 989 pprev = &icmp6_dst_gc_list;
@@ -993,16 +992,15 @@ int icmp6_dst_gc(int *more)
993 if (!atomic_read(&dst->__refcnt)) { 992 if (!atomic_read(&dst->__refcnt)) {
994 *pprev = dst->next; 993 *pprev = dst->next;
995 dst_free(dst); 994 dst_free(dst);
996 freed++;
997 } else { 995 } else {
998 pprev = &dst->next; 996 pprev = &dst->next;
999 (*more)++; 997 ++more;
1000 } 998 }
1001 } 999 }
1002 1000
1003 spin_unlock_bh(&icmp6_dst_lock); 1001 spin_unlock_bh(&icmp6_dst_lock);
1004 1002
1005 return freed; 1003 return more;
1006} 1004}
1007 1005
1008static int ip6_dst_gc(struct dst_ops *ops) 1006static int ip6_dst_gc(struct dst_ops *ops)