vserver 1.9.3
[linux-2.6.git] / net / sched / sch_cbq.c
index 01dfcb1..2ae7382 100644 (file)
@@ -1675,7 +1675,6 @@ cbq_dump_class(struct Qdisc *sch, unsigned long arg,
        cl->xstats.undertime = 0;
        if (!PSCHED_IS_PASTPERFECT(cl->undertime))
                cl->xstats.undertime = PSCHED_TDIFF(cl->undertime, q->now);
-       q->link.xstats.avgidle = q->link.avgidle;
        if (cbq_copy_xstats(skb, &cl->xstats)) {
                spin_unlock_bh(&sch->dev->queue_lock);
                goto rtattr_failure;
@@ -1746,15 +1745,18 @@ static void cbq_destroy_filters(struct cbq_class *cl)
        }
 }
 
-static void cbq_destroy_class(struct cbq_class *cl)
+static void cbq_destroy_class(struct Qdisc *sch, struct cbq_class *cl)
 {
+       struct cbq_sched_data *q = qdisc_priv(sch);
+
        cbq_destroy_filters(cl);
        qdisc_destroy(cl->q);
        qdisc_put_rtab(cl->R_tab);
 #ifdef CONFIG_NET_ESTIMATOR
        qdisc_kill_estimator(&cl->stats);
 #endif
-       kfree(cl);
+       if (cl != &q->link)
+               kfree(cl);
 }
 
 static void
@@ -1767,22 +1769,15 @@ cbq_destroy(struct Qdisc* sch)
 #ifdef CONFIG_NET_CLS_POLICE
        q->rx_class = NULL;
 #endif
-       for (h = 0; h < 16; h++) {
-               for (cl = q->classes[h]; cl; cl = cl->next)
-                       cbq_destroy_filters(cl);
-       }
 
        for (h = 0; h < 16; h++) {
                struct cbq_class *next;
 
                for (cl = q->classes[h]; cl; cl = next) {
                        next = cl->next;
-                       if (cl != &q->link)
-                               cbq_destroy_class(cl);
+                       cbq_destroy_class(sch, cl);
                }
        }
-
-       qdisc_put_rtab(q->link.R_tab);
 }
 
 static void cbq_put(struct Qdisc *sch, unsigned long arg)
@@ -1799,7 +1794,7 @@ static void cbq_put(struct Qdisc *sch, unsigned long arg)
                spin_unlock_bh(&sch->dev->queue_lock);
 #endif
 
-               cbq_destroy_class(cl);
+               cbq_destroy_class(sch, cl);
        }
 }
 
@@ -2035,7 +2030,7 @@ static int cbq_delete(struct Qdisc *sch, unsigned long arg)
        sch_tree_unlock(sch);
 
        if (--cl->refcnt == 0)
-               cbq_destroy_class(cl);
+               cbq_destroy_class(sch, cl);
 
        return 0;
 }