diff options
author | David S. Miller <davem@davemloft.net> | 2012-06-26 03:10:09 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2012-06-26 03:10:09 -0400 |
commit | df67e6c9a6ca59ca96bdd46a500ae9dd596f427c (patch) | |
tree | a47beac0b03b7f03c2ad9d982e50c7b33cb7d182 | |
parent | 29cb99de4dafc53f75389bbe0173af4385a2ed1d (diff) |
ipv4: Remove unnecessary code from rt_check_expire().
IPv4 routing cache entries no longer use dst->expires, because the
metrics, PMTU, and redirect information are stored in the inetpeer
cache.
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | net/ipv4/route.c | 34 |
1 files changed, 11 insertions, 23 deletions
diff --git a/net/ipv4/route.c b/net/ipv4/route.c index 8d62d85e68dc..846961c6cbe1 100644 --- a/net/ipv4/route.c +++ b/net/ipv4/route.c | |||
@@ -870,34 +870,22 @@ static void rt_check_expire(void) | |||
870 | while ((rth = rcu_dereference_protected(*rthp, | 870 | while ((rth = rcu_dereference_protected(*rthp, |
871 | lockdep_is_held(rt_hash_lock_addr(i)))) != NULL) { | 871 | lockdep_is_held(rt_hash_lock_addr(i)))) != NULL) { |
872 | prefetch(rth->dst.rt_next); | 872 | prefetch(rth->dst.rt_next); |
873 | if (rt_is_expired(rth)) { | 873 | if (rt_is_expired(rth) || |
874 | rt_may_expire(rth, tmo, ip_rt_gc_timeout)) { | ||
874 | *rthp = rth->dst.rt_next; | 875 | *rthp = rth->dst.rt_next; |
875 | rt_free(rth); | 876 | rt_free(rth); |
876 | continue; | 877 | continue; |
877 | } | 878 | } |
878 | if (rth->dst.expires) { | ||
879 | /* Entry is expired even if it is in use */ | ||
880 | if (time_before_eq(jiffies, rth->dst.expires)) { | ||
881 | nofree: | ||
882 | tmo >>= 1; | ||
883 | rthp = &rth->dst.rt_next; | ||
884 | /* | ||
885 | * We only count entries on | ||
886 | * a chain with equal hash inputs once | ||
887 | * so that entries for different QOS | ||
888 | * levels, and other non-hash input | ||
889 | * attributes don't unfairly skew | ||
890 | * the length computation | ||
891 | */ | ||
892 | length += has_noalias(rt_hash_table[i].chain, rth); | ||
893 | continue; | ||
894 | } | ||
895 | } else if (!rt_may_expire(rth, tmo, ip_rt_gc_timeout)) | ||
896 | goto nofree; | ||
897 | 879 | ||
898 | /* Cleanup aged off entries. */ | 880 | /* We only count entries on a chain with equal |
899 | *rthp = rth->dst.rt_next; | 881 | * hash inputs once so that entries for |
900 | rt_free(rth); | 882 | * different QOS levels, and other non-hash |
883 | * input attributes don't unfairly skew the | ||
884 | * length computation | ||
885 | */ | ||
886 | tmo >>= 1; | ||
887 | rthp = &rth->dst.rt_next; | ||
888 | length += has_noalias(rt_hash_table[i].chain, rth); | ||
901 | } | 889 | } |
902 | spin_unlock_bh(rt_hash_lock_addr(i)); | 890 | spin_unlock_bh(rt_hash_lock_addr(i)); |
903 | sum += length; | 891 | sum += length; |