net_sched: introduce qdisc_replace() helper
Remove nearly duplicated code and prepare for the following patch. Cc: Jamal Hadi Salim <jhs@mojatatu.com> Acked-by: Jamal Hadi Salim <jhs@mojatatu.com> Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:

committed by
David S. Miller

parent
f12d33f4d8
commit
86a7996cc8
@@ -617,11 +617,7 @@ static int qfq_graft_class(struct Qdisc *sch, unsigned long arg,
|
||||
new = &noop_qdisc;
|
||||
}
|
||||
|
||||
sch_tree_lock(sch);
|
||||
qfq_purge_queue(cl);
|
||||
*old = cl->qdisc;
|
||||
cl->qdisc = new;
|
||||
sch_tree_unlock(sch);
|
||||
*old = qdisc_replace(sch, new, &cl->qdisc);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user