]> err.no Git - linux-2.6/blobdiff - kernel/hrtimer.c
[RBTREE] Update hrtimers to use rb_parent() accessor macro.
[linux-2.6] / kernel / hrtimer.c
index 49cbf7cffebd1e75c8142b180c472f7f1f0a786c..04ab27ddfd90d60674856e67a5dd69a96572cab6 100644 (file)
@@ -393,7 +393,7 @@ static void __remove_hrtimer(struct hrtimer *timer, struct hrtimer_base *base)
        if (base->first == &timer->node)
                base->first = rb_next(&timer->node);
        rb_erase(&timer->node, &base->active);
-       timer->node.rb_parent = HRTIMER_INACTIVE;
+       rb_set_parent(&timer->node, &timer->node);
 }
 
 /*
@@ -501,6 +501,7 @@ int hrtimer_cancel(struct hrtimer *timer)
 
                if (ret >= 0)
                        return ret;
+               cpu_relax();
        }
 }
 
@@ -577,7 +578,7 @@ void hrtimer_init(struct hrtimer *timer, clockid_t clock_id,
                clock_id = CLOCK_MONOTONIC;
 
        timer->base = &bases[clock_id];
-       timer->node.rb_parent = HRTIMER_INACTIVE;
+       rb_set_parent(&timer->node, &timer->node);
 }
 
 /**
@@ -606,6 +607,9 @@ static inline void run_hrtimer_queue(struct hrtimer_base *base)
 {
        struct rb_node *node;
 
+       if (!base->first)
+               return;
+
        if (base->get_softirq_time)
                base->softirq_time = base->get_softirq_time();