Commit 4502a4e1 authored by Randy Dunlap's avatar Randy Dunlap Committed by David S. Miller

[IPV6]: Use time_after() etc. for comparing jiffies.

parent 5433a827
......@@ -1179,14 +1179,14 @@ static int fib6_age(struct rt6_info *rt, void *arg)
*/
if (rt->rt6i_flags&RTF_EXPIRES && rt->rt6i_expires) {
if ((long)(now - rt->rt6i_expires) > 0) {
if (time_after(now, rt->rt6i_expires)) {
RT6_TRACE("expiring %p\n", rt);
return -1;
}
gc_args.more++;
} else if (rt->rt6i_flags & RTF_CACHE) {
if (atomic_read(&rt->u.dst.__refcnt) == 0 &&
(long)(now - rt->u.dst.lastuse) >= gc_args.timeout) {
time_after_eq(now, rt->u.dst.lastuse + gc_args.timeout)) {
RT6_TRACE("aging clone %p\n", rt);
return -1;
}
......
......@@ -565,7 +565,7 @@ static int ip6_dst_gc()
static unsigned long last_gc;
unsigned long now = jiffies;
if ((long)(now - last_gc) < ip6_rt_gc_min_interval &&
if (time_after(last_gc + ip6_rt_gc_min_interval, now) &&
atomic_read(&ip6_dst_ops.entries) <= ip6_rt_max_size)
goto out;
......
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