Commit 53f2191e authored by Colin Gibbs's avatar Colin Gibbs Committed by David S. Miller

[NET_SCHED]: Use time_after, fixes htb on 64-bit arch.

parent ae26e2ef
...@@ -437,13 +437,13 @@ static void htb_add_to_wait_tree (struct htb_sched *q, ...@@ -437,13 +437,13 @@ static void htb_add_to_wait_tree (struct htb_sched *q,
cl->pq_key++; cl->pq_key++;
/* update the nearest event cache */ /* update the nearest event cache */
if (q->near_ev_cache[cl->level] - cl->pq_key < 0x80000000) if (time_after(q->near_ev_cache[cl->level], cl->pq_key))
q->near_ev_cache[cl->level] = cl->pq_key; q->near_ev_cache[cl->level] = cl->pq_key;
while (*p) { while (*p) {
struct htb_class *c; parent = *p; struct htb_class *c; parent = *p;
c = rb_entry(parent, struct htb_class, pq_node); c = rb_entry(parent, struct htb_class, pq_node);
if (cl->pq_key - c->pq_key < 0x80000000) if (time_after_eq(cl->pq_key, c->pq_key))
p = &parent->rb_right; p = &parent->rb_right;
else else
p = &parent->rb_left; p = &parent->rb_left;
...@@ -869,7 +869,7 @@ static long htb_do_events(struct htb_sched *q,int level) ...@@ -869,7 +869,7 @@ static long htb_do_events(struct htb_sched *q,int level)
while (p->rb_left) p = p->rb_left; while (p->rb_left) p = p->rb_left;
cl = rb_entry(p, struct htb_class, pq_node); cl = rb_entry(p, struct htb_class, pq_node);
if (cl->pq_key - (q->jiffies+1) < 0x80000000) { if (time_after(cl->pq_key, q->jiffies)) {
HTB_DBG(8,3,"htb_do_ev_ret delay=%ld\n",cl->pq_key - q->jiffies); HTB_DBG(8,3,"htb_do_ev_ret delay=%ld\n",cl->pq_key - q->jiffies);
return cl->pq_key - q->jiffies; return cl->pq_key - q->jiffies;
} }
...@@ -1048,7 +1048,7 @@ static struct sk_buff *htb_dequeue(struct Qdisc *sch) ...@@ -1048,7 +1048,7 @@ static struct sk_buff *htb_dequeue(struct Qdisc *sch)
/* common case optimization - skip event handler quickly */ /* common case optimization - skip event handler quickly */
int m; int m;
long delay; long delay;
if (q->jiffies - q->near_ev_cache[level] < 0x80000000 || 0) { if (time_after_eq(q->jiffies, q->near_ev_cache[level])) {
delay = htb_do_events(q,level); delay = htb_do_events(q,level);
q->near_ev_cache[level] = q->jiffies + (delay ? delay : HZ); q->near_ev_cache[level] = q->jiffies + (delay ? delay : HZ);
#ifdef HTB_DEBUG #ifdef HTB_DEBUG
......
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