aboutsummaryrefslogtreecommitdiffstats
path: root/net/sched/sch_htb.c
diff options
context:
space:
mode:
authorPatrick McHardy <kaber@trash.net>2007-03-23 14:29:43 -0400
committerDavid S. Miller <davem@sunset.davemloft.net>2007-04-26 01:27:56 -0400
commita48b5a61448899040dfbd2e0cd55b06a2bd2466c (patch)
treeb7efde642bde0eec3cb7171fdda38de349e409ff /net/sched/sch_htb.c
parent3bebcda28077375470dd60545b71bba2f83335fd (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_htb.c')
-rw-r--r--net/sched/sch_htb.c14
1 files changed, 2 insertions, 12 deletions
diff --git a/net/sched/sch_htb.c b/net/sched/sch_htb.c
index 3f528554b0d4..99bcec8dd04c 100644
--- a/net/sched/sch_htb.c
+++ b/net/sched/sch_htb.c
@@ -1236,16 +1236,6 @@ static unsigned long htb_get(struct Qdisc *sch, u32 classid)
1236 return (unsigned long)cl; 1236 return (unsigned long)cl;
1237} 1237}
1238 1238
1239static void htb_destroy_filters(struct tcf_proto **fl)
1240{
1241 struct tcf_proto *tp;
1242
1243 while ((tp = *fl) != NULL) {
1244 *fl = tp->next;
1245 tcf_destroy(tp);
1246 }
1247}
1248
1249static inline int htb_parent_last_child(struct htb_class *cl) 1239static inline int htb_parent_last_child(struct htb_class *cl)
1250{ 1240{
1251 if (!cl->parent) 1241 if (!cl->parent)
@@ -1289,7 +1279,7 @@ static void htb_destroy_class(struct Qdisc *sch, struct htb_class *cl)
1289 qdisc_put_rtab(cl->rate); 1279 qdisc_put_rtab(cl->rate);
1290 qdisc_put_rtab(cl->ceil); 1280 qdisc_put_rtab(cl->ceil);
1291 1281
1292 htb_destroy_filters(&cl->filter_list); 1282 tcf_destroy_chain(cl->filter_list);
1293 1283
1294 while (!list_empty(&cl->children)) 1284 while (!list_empty(&cl->children))
1295 htb_destroy_class(sch, list_entry(cl->children.next, 1285 htb_destroy_class(sch, list_entry(cl->children.next,
@@ -1321,7 +1311,7 @@ static void htb_destroy(struct Qdisc *sch)
1321 and surprisingly it worked in 2.4. But it must precede it 1311 and surprisingly it worked in 2.4. But it must precede it
1322 because filter need its target class alive to be able to call 1312 because filter need its target class alive to be able to call
1323 unbind_filter on it (without Oops). */ 1313 unbind_filter on it (without Oops). */
1324 htb_destroy_filters(&q->filter_list); 1314 tcf_destroy_chain(q->filter_list);
1325 1315
1326 while (!list_empty(&q->root)) 1316 while (!list_empty(&q->root))
1327 htb_destroy_class(sch, list_entry(q->root.next, 1317 htb_destroy_class(sch, list_entry(q->root.next,