diff options
Diffstat (limited to 'kernel/net/sched/sch_red.c')
-rw-r--r-- | kernel/net/sched/sch_red.c | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/kernel/net/sched/sch_red.c b/kernel/net/sched/sch_red.c index 6c0534cc7..8c0508c0e 100644 --- a/kernel/net/sched/sch_red.c +++ b/kernel/net/sched/sch_red.c @@ -210,7 +210,8 @@ static int red_change(struct Qdisc *sch, struct nlattr *opt) q->flags = ctl->flags; q->limit = ctl->limit; if (child) { - qdisc_tree_decrease_qlen(q->qdisc, q->qdisc->q.qlen); + qdisc_tree_reduce_backlog(q->qdisc, q->qdisc->q.qlen, + q->qdisc->qstats.backlog); qdisc_destroy(q->qdisc); q->qdisc = child; } @@ -313,12 +314,7 @@ static int red_graft(struct Qdisc *sch, unsigned long arg, struct Qdisc *new, if (new == NULL) new = &noop_qdisc; - sch_tree_lock(sch); - *old = q->qdisc; - q->qdisc = new; - qdisc_tree_decrease_qlen(*old, (*old)->q.qlen); - qdisc_reset(*old); - sch_tree_unlock(sch); + *old = qdisc_replace(sch, new, &q->qdisc); return 0; } |