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;
}
}
-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
#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)
spin_unlock_bh(&sch->dev->queue_lock);
#endif
- cbq_destroy_class(cl);
+ cbq_destroy_class(sch, cl);
}
}
sch_tree_unlock(sch);
if (--cl->refcnt == 0)
- cbq_destroy_class(cl);
+ cbq_destroy_class(sch, cl);
return 0;
}