diff options
author | Patrick McHardy <kaber@trash.net> | 2007-03-23 14:29:43 -0400 |
---|---|---|
committer | David S. Miller <davem@sunset.davemloft.net> | 2007-04-26 01:27:56 -0400 |
commit | a48b5a61448899040dfbd2e0cd55b06a2bd2466c (patch) | |
tree | b7efde642bde0eec3cb7171fdda38de349e409ff /net/sched/sch_cbq.c | |
parent | 3bebcda28077375470dd60545b71bba2f83335fd (diff) |
[NET_SCHED]: Unline tcf_destroy
Uninline tcf_destroy and add a helper function to destroy an entire filter
chain.
Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/sched/sch_cbq.c')
-rw-r--r-- | net/sched/sch_cbq.c | 14 |
1 files changed, 2 insertions, 12 deletions
diff --git a/net/sched/sch_cbq.c b/net/sched/sch_cbq.c index 414a97c962f1..a294542cb8e4 100644 --- a/net/sched/sch_cbq.c +++ b/net/sched/sch_cbq.c | |||
@@ -1717,23 +1717,13 @@ static unsigned long cbq_get(struct Qdisc *sch, u32 classid) | |||
1717 | return 0; | 1717 | return 0; |
1718 | } | 1718 | } |
1719 | 1719 | ||
1720 | static void cbq_destroy_filters(struct cbq_class *cl) | ||
1721 | { | ||
1722 | struct tcf_proto *tp; | ||
1723 | |||
1724 | while ((tp = cl->filter_list) != NULL) { | ||
1725 | cl->filter_list = tp->next; | ||
1726 | tcf_destroy(tp); | ||
1727 | } | ||
1728 | } | ||
1729 | |||
1730 | static void cbq_destroy_class(struct Qdisc *sch, struct cbq_class *cl) | 1720 | static void cbq_destroy_class(struct Qdisc *sch, struct cbq_class *cl) |
1731 | { | 1721 | { |
1732 | struct cbq_sched_data *q = qdisc_priv(sch); | 1722 | struct cbq_sched_data *q = qdisc_priv(sch); |
1733 | 1723 | ||
1734 | BUG_TRAP(!cl->filters); | 1724 | BUG_TRAP(!cl->filters); |
1735 | 1725 | ||
1736 | cbq_destroy_filters(cl); | 1726 | tcf_destroy_chain(cl->filter_list); |
1737 | qdisc_destroy(cl->q); | 1727 | qdisc_destroy(cl->q); |
1738 | qdisc_put_rtab(cl->R_tab); | 1728 | qdisc_put_rtab(cl->R_tab); |
1739 | #ifdef CONFIG_NET_ESTIMATOR | 1729 | #ifdef CONFIG_NET_ESTIMATOR |
@@ -1760,7 +1750,7 @@ cbq_destroy(struct Qdisc* sch) | |||
1760 | */ | 1750 | */ |
1761 | for (h = 0; h < 16; h++) | 1751 | for (h = 0; h < 16; h++) |
1762 | for (cl = q->classes[h]; cl; cl = cl->next) | 1752 | for (cl = q->classes[h]; cl; cl = cl->next) |
1763 | cbq_destroy_filters(cl); | 1753 | tcf_destroy_chain(cl->filter_list); |
1764 | 1754 | ||
1765 | for (h = 0; h < 16; h++) { | 1755 | for (h = 0; h < 16; h++) { |
1766 | struct cbq_class *next; | 1756 | struct cbq_class *next; |