summaryrefslogtreecommitdiffstats
path: root/net/sched/sch_cbq.c
diff options
context:
space:
mode:
authorWANG Cong <xiyou.wangcong@gmail.com>2016-02-25 14:55:00 -0800
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2016-05-18 17:06:39 -0700
commit1188e1403a772d9698c06bcc53c44783536ff09e (patch)
treeab35ab1d01739e289a4dee4ca76d16f910801bf9 /net/sched/sch_cbq.c
parentc985780791efec375865c0fbd21794d631c68fce (diff)
downloadlinux-stable-1188e1403a772d9698c06bcc53c44783536ff09e.tar.gz
linux-stable-1188e1403a772d9698c06bcc53c44783536ff09e.tar.bz2
linux-stable-1188e1403a772d9698c06bcc53c44783536ff09e.zip
net_sched: introduce qdisc_replace() helper
[ Upstream commit 86a7996cc8a078793670d82ed97d5a99bb4e8496 ] 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> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'net/sched/sch_cbq.c')
-rw-r--r--net/sched/sch_cbq.c7
1 files changed, 1 insertions, 6 deletions
diff --git a/net/sched/sch_cbq.c b/net/sched/sch_cbq.c
index c538d9e4a8f6..7f8474cdce32 100644
--- a/net/sched/sch_cbq.c
+++ b/net/sched/sch_cbq.c
@@ -1624,13 +1624,8 @@ static int cbq_graft(struct Qdisc *sch, unsigned long arg, struct Qdisc *new,
new->reshape_fail = cbq_reshape_fail;
#endif
}
- sch_tree_lock(sch);
- *old = cl->q;
- cl->q = new;
- qdisc_tree_decrease_qlen(*old, (*old)->q.qlen);
- qdisc_reset(*old);
- sch_tree_unlock(sch);
+ *old = qdisc_replace(sch, new, &cl->q);
return 0;
}