diff options
author | David S. Miller <davem@davemloft.net> | 2012-06-26 00:10:09 -0700 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2012-06-26 00:10:09 -0700 |
commit | df67e6c9a6ca59ca96bdd46a500ae9dd596f427c (patch) | |
tree | a47beac0b03b7f03c2ad9d982e50c7b33cb7d182 /net/ipv4 | |
parent | 29cb99de4dafc53f75389bbe0173af4385a2ed1d (diff) | |
download | talos-obmc-linux-df67e6c9a6ca59ca96bdd46a500ae9dd596f427c.tar.gz talos-obmc-linux-df67e6c9a6ca59ca96bdd46a500ae9dd596f427c.zip |
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>
Diffstat (limited to 'net/ipv4')
-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) while ((rth = rcu_dereference_protected(*rthp, lockdep_is_held(rt_hash_lock_addr(i)))) != NULL) { prefetch(rth->dst.rt_next); - if (rt_is_expired(rth)) { + if (rt_is_expired(rth) || + rt_may_expire(rth, tmo, ip_rt_gc_timeout)) { *rthp = rth->dst.rt_next; rt_free(rth); continue; } - if (rth->dst.expires) { - /* Entry is expired even if it is in use */ - if (time_before_eq(jiffies, rth->dst.expires)) { -nofree: - tmo >>= 1; - rthp = &rth->dst.rt_next; - /* - * We only count entries on - * a chain with equal hash inputs once - * so that entries for different QOS - * levels, and other non-hash input - * attributes don't unfairly skew - * the length computation - */ - length += has_noalias(rt_hash_table[i].chain, rth); - continue; - } - } else if (!rt_may_expire(rth, tmo, ip_rt_gc_timeout)) - goto nofree; - /* Cleanup aged off entries. */ - *rthp = rth->dst.rt_next; - rt_free(rth); + /* We only count entries on a chain with equal + * hash inputs once so that entries for + * different QOS levels, and other non-hash + * input attributes don't unfairly skew the + * length computation + */ + tmo >>= 1; + rthp = &rth->dst.rt_next; + length += has_noalias(rt_hash_table[i].chain, rth); } spin_unlock_bh(rt_hash_lock_addr(i)); sum += length; |