summaryrefslogtreecommitdiffstats
path: root/net/sched/sch_hfsc.c
diff options
context:
space:
mode:
authorWANG Cong <xiyou.wangcong@gmail.com>2016-02-25 14:55:00 -0800
committerDavid S. Miller <davem@davemloft.net>2016-02-29 17:02:33 -0500
commit86a7996cc8a078793670d82ed97d5a99bb4e8496 (patch)
tree8e5d26eb9e58b0c362c66f73baa5261793223178 /net/sched/sch_hfsc.c
parentf12d33f4d83c6837d176e1aef337914089c77957 (diff)
downloadlinux-86a7996cc8a078793670d82ed97d5a99bb4e8496.tar.gz
linux-86a7996cc8a078793670d82ed97d5a99bb4e8496.tar.bz2
linux-86a7996cc8a078793670d82ed97d5a99bb4e8496.zip
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>
Diffstat (limited to 'net/sched/sch_hfsc.c')
-rw-r--r--net/sched/sch_hfsc.c6
1 files changed, 1 insertions, 5 deletions
diff --git a/net/sched/sch_hfsc.c b/net/sched/sch_hfsc.c
index b7ebe2c87586..089f3b667d36 100644
--- a/net/sched/sch_hfsc.c
+++ b/net/sched/sch_hfsc.c
@@ -1215,11 +1215,7 @@ hfsc_graft_class(struct Qdisc *sch, unsigned long arg, struct Qdisc *new,
new = &noop_qdisc;
}
- sch_tree_lock(sch);
- hfsc_purge_queue(sch, cl);
- *old = cl->qdisc;
- cl->qdisc = new;
- sch_tree_unlock(sch);
+ *old = qdisc_replace(sch, new, &cl->qdisc);
return 0;
}