diff options
author | Patrick McHardy <kaber@trash.net> | 2008-07-01 22:52:38 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-07-01 22:52:38 -0400 |
commit | ff31ab56c0e900235f653e375fc3b01ba2d8d6a3 (patch) | |
tree | e35bab914ce853527e1531dc7681a13a08720ed6 /net | |
parent | 77a538d5aa25a8866606a1faa4300c9aa2a59dfc (diff) |
net-sched: change tcf_destroy_chain() to clear start of filter list
Pass double tcf_proto pointers to tcf_destroy_chain() to make it
clear the start of the filter list for more consistency.
Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net')
-rw-r--r-- | net/mac80211/wme.c | 3 | ||||
-rw-r--r-- | net/sched/sch_api.c | 6 | ||||
-rw-r--r-- | net/sched/sch_atm.c | 5 | ||||
-rw-r--r-- | net/sched/sch_cbq.c | 8 | ||||
-rw-r--r-- | net/sched/sch_dsmark.c | 2 | ||||
-rw-r--r-- | net/sched/sch_hfsc.c | 2 | ||||
-rw-r--r-- | net/sched/sch_htb.c | 4 | ||||
-rw-r--r-- | net/sched/sch_ingress.c | 2 | ||||
-rw-r--r-- | net/sched/sch_prio.c | 2 | ||||
-rw-r--r-- | net/sched/sch_sfq.c | 2 |
10 files changed, 16 insertions, 20 deletions
diff --git a/net/mac80211/wme.c b/net/mac80211/wme.c index 635b996c8c3..5d09e8698b5 100644 --- a/net/mac80211/wme.c +++ b/net/mac80211/wme.c | |||
@@ -323,8 +323,7 @@ static void wme_qdiscop_destroy(struct Qdisc* qd) | |||
323 | struct ieee80211_hw *hw = &local->hw; | 323 | struct ieee80211_hw *hw = &local->hw; |
324 | int queue; | 324 | int queue; |
325 | 325 | ||
326 | tcf_destroy_chain(q->filter_list); | 326 | tcf_destroy_chain(&q->filter_list); |
327 | q->filter_list = NULL; | ||
328 | 327 | ||
329 | for (queue=0; queue < hw->queues; queue++) { | 328 | for (queue=0; queue < hw->queues; queue++) { |
330 | skb_queue_purge(&q->requeued[queue]); | 329 | skb_queue_purge(&q->requeued[queue]); |
diff --git a/net/sched/sch_api.c b/net/sched/sch_api.c index c40773cdbe4..10f01ad0438 100644 --- a/net/sched/sch_api.c +++ b/net/sched/sch_api.c | |||
@@ -1252,12 +1252,12 @@ void tcf_destroy(struct tcf_proto *tp) | |||
1252 | kfree(tp); | 1252 | kfree(tp); |
1253 | } | 1253 | } |
1254 | 1254 | ||
1255 | void tcf_destroy_chain(struct tcf_proto *fl) | 1255 | void tcf_destroy_chain(struct tcf_proto **fl) |
1256 | { | 1256 | { |
1257 | struct tcf_proto *tp; | 1257 | struct tcf_proto *tp; |
1258 | 1258 | ||
1259 | while ((tp = fl) != NULL) { | 1259 | while ((tp = *fl) != NULL) { |
1260 | fl = tp->next; | 1260 | *fl = tp->next; |
1261 | tcf_destroy(tp); | 1261 | tcf_destroy(tp); |
1262 | } | 1262 | } |
1263 | } | 1263 | } |
diff --git a/net/sched/sch_atm.c b/net/sched/sch_atm.c index 33527341638..8e5f70ba3a1 100644 --- a/net/sched/sch_atm.c +++ b/net/sched/sch_atm.c | |||
@@ -160,7 +160,7 @@ static void atm_tc_put(struct Qdisc *sch, unsigned long cl) | |||
160 | *prev = flow->next; | 160 | *prev = flow->next; |
161 | pr_debug("atm_tc_put: qdisc %p\n", flow->q); | 161 | pr_debug("atm_tc_put: qdisc %p\n", flow->q); |
162 | qdisc_destroy(flow->q); | 162 | qdisc_destroy(flow->q); |
163 | tcf_destroy_chain(flow->filter_list); | 163 | tcf_destroy_chain(&flow->filter_list); |
164 | if (flow->sock) { | 164 | if (flow->sock) { |
165 | pr_debug("atm_tc_put: f_count %d\n", | 165 | pr_debug("atm_tc_put: f_count %d\n", |
166 | file_count(flow->sock->file)); | 166 | file_count(flow->sock->file)); |
@@ -588,8 +588,7 @@ static void atm_tc_destroy(struct Qdisc *sch) | |||
588 | pr_debug("atm_tc_destroy(sch %p,[qdisc %p])\n", sch, p); | 588 | pr_debug("atm_tc_destroy(sch %p,[qdisc %p])\n", sch, p); |
589 | /* races ? */ | 589 | /* races ? */ |
590 | while ((flow = p->flows)) { | 590 | while ((flow = p->flows)) { |
591 | tcf_destroy_chain(flow->filter_list); | 591 | tcf_destroy_chain(&flow->filter_list); |
592 | flow->filter_list = NULL; | ||
593 | if (flow->ref > 1) | 592 | if (flow->ref > 1) |
594 | printk(KERN_ERR "atm_destroy: %p->ref = %d\n", flow, | 593 | printk(KERN_ERR "atm_destroy: %p->ref = %d\n", flow, |
595 | flow->ref); | 594 | flow->ref); |
diff --git a/net/sched/sch_cbq.c b/net/sched/sch_cbq.c index 09969c1fbc0..2a3c97f7dc6 100644 --- a/net/sched/sch_cbq.c +++ b/net/sched/sch_cbq.c | |||
@@ -1704,7 +1704,7 @@ static void cbq_destroy_class(struct Qdisc *sch, struct cbq_class *cl) | |||
1704 | 1704 | ||
1705 | BUG_TRAP(!cl->filters); | 1705 | BUG_TRAP(!cl->filters); |
1706 | 1706 | ||
1707 | tcf_destroy_chain(cl->filter_list); | 1707 | tcf_destroy_chain(&cl->filter_list); |
1708 | qdisc_destroy(cl->q); | 1708 | qdisc_destroy(cl->q); |
1709 | qdisc_put_rtab(cl->R_tab); | 1709 | qdisc_put_rtab(cl->R_tab); |
1710 | gen_kill_estimator(&cl->bstats, &cl->rate_est); | 1710 | gen_kill_estimator(&cl->bstats, &cl->rate_est); |
@@ -1728,10 +1728,8 @@ cbq_destroy(struct Qdisc* sch) | |||
1728 | * be bound to classes which have been destroyed already. --TGR '04 | 1728 | * be bound to classes which have been destroyed already. --TGR '04 |
1729 | */ | 1729 | */ |
1730 | for (h = 0; h < 16; h++) { | 1730 | for (h = 0; h < 16; h++) { |
1731 | for (cl = q->classes[h]; cl; cl = cl->next) { | 1731 | for (cl = q->classes[h]; cl; cl = cl->next) |
1732 | tcf_destroy_chain(cl->filter_list); | 1732 | tcf_destroy_chain(&cl->filter_list); |
1733 | cl->filter_list = NULL; | ||
1734 | } | ||
1735 | } | 1733 | } |
1736 | for (h = 0; h < 16; h++) { | 1734 | for (h = 0; h < 16; h++) { |
1737 | struct cbq_class *next; | 1735 | struct cbq_class *next; |
diff --git a/net/sched/sch_dsmark.c b/net/sched/sch_dsmark.c index 64465bacbe7..c4c1317cd47 100644 --- a/net/sched/sch_dsmark.c +++ b/net/sched/sch_dsmark.c | |||
@@ -416,7 +416,7 @@ static void dsmark_destroy(struct Qdisc *sch) | |||
416 | 416 | ||
417 | pr_debug("dsmark_destroy(sch %p,[qdisc %p])\n", sch, p); | 417 | pr_debug("dsmark_destroy(sch %p,[qdisc %p])\n", sch, p); |
418 | 418 | ||
419 | tcf_destroy_chain(p->filter_list); | 419 | tcf_destroy_chain(&p->filter_list); |
420 | qdisc_destroy(p->q); | 420 | qdisc_destroy(p->q); |
421 | kfree(p->mask); | 421 | kfree(p->mask); |
422 | } | 422 | } |
diff --git a/net/sched/sch_hfsc.c b/net/sched/sch_hfsc.c index fdfaa3fcc16..eca83a3be29 100644 --- a/net/sched/sch_hfsc.c +++ b/net/sched/sch_hfsc.c | |||
@@ -1123,7 +1123,7 @@ hfsc_destroy_class(struct Qdisc *sch, struct hfsc_class *cl) | |||
1123 | { | 1123 | { |
1124 | struct hfsc_sched *q = qdisc_priv(sch); | 1124 | struct hfsc_sched *q = qdisc_priv(sch); |
1125 | 1125 | ||
1126 | tcf_destroy_chain(cl->filter_list); | 1126 | tcf_destroy_chain(&cl->filter_list); |
1127 | qdisc_destroy(cl->qdisc); | 1127 | qdisc_destroy(cl->qdisc); |
1128 | gen_kill_estimator(&cl->bstats, &cl->rate_est); | 1128 | gen_kill_estimator(&cl->bstats, &cl->rate_est); |
1129 | if (cl != &q->root) | 1129 | if (cl != &q->root) |
diff --git a/net/sched/sch_htb.c b/net/sched/sch_htb.c index 6807c97985a..3fb58f428f7 100644 --- a/net/sched/sch_htb.c +++ b/net/sched/sch_htb.c | |||
@@ -1238,7 +1238,7 @@ static void htb_destroy_class(struct Qdisc *sch, struct htb_class *cl) | |||
1238 | qdisc_put_rtab(cl->rate); | 1238 | qdisc_put_rtab(cl->rate); |
1239 | qdisc_put_rtab(cl->ceil); | 1239 | qdisc_put_rtab(cl->ceil); |
1240 | 1240 | ||
1241 | tcf_destroy_chain(cl->filter_list); | 1241 | tcf_destroy_chain(&cl->filter_list); |
1242 | 1242 | ||
1243 | while (!list_empty(&cl->children)) | 1243 | while (!list_empty(&cl->children)) |
1244 | htb_destroy_class(sch, list_entry(cl->children.next, | 1244 | htb_destroy_class(sch, list_entry(cl->children.next, |
@@ -1267,7 +1267,7 @@ static void htb_destroy(struct Qdisc *sch) | |||
1267 | and surprisingly it worked in 2.4. But it must precede it | 1267 | and surprisingly it worked in 2.4. But it must precede it |
1268 | because filter need its target class alive to be able to call | 1268 | because filter need its target class alive to be able to call |
1269 | unbind_filter on it (without Oops). */ | 1269 | unbind_filter on it (without Oops). */ |
1270 | tcf_destroy_chain(q->filter_list); | 1270 | tcf_destroy_chain(&q->filter_list); |
1271 | 1271 | ||
1272 | while (!list_empty(&q->root)) | 1272 | while (!list_empty(&q->root)) |
1273 | htb_destroy_class(sch, list_entry(q->root.next, | 1273 | htb_destroy_class(sch, list_entry(q->root.next, |
diff --git a/net/sched/sch_ingress.c b/net/sched/sch_ingress.c index 274b1ddb160..956c80ad596 100644 --- a/net/sched/sch_ingress.c +++ b/net/sched/sch_ingress.c | |||
@@ -104,7 +104,7 @@ static void ingress_destroy(struct Qdisc *sch) | |||
104 | { | 104 | { |
105 | struct ingress_qdisc_data *p = qdisc_priv(sch); | 105 | struct ingress_qdisc_data *p = qdisc_priv(sch); |
106 | 106 | ||
107 | tcf_destroy_chain(p->filter_list); | 107 | tcf_destroy_chain(&p->filter_list); |
108 | } | 108 | } |
109 | 109 | ||
110 | static int ingress_dump(struct Qdisc *sch, struct sk_buff *skb) | 110 | static int ingress_dump(struct Qdisc *sch, struct sk_buff *skb) |
diff --git a/net/sched/sch_prio.c b/net/sched/sch_prio.c index 4aa2b45dad0..5532f1031ab 100644 --- a/net/sched/sch_prio.c +++ b/net/sched/sch_prio.c | |||
@@ -219,7 +219,7 @@ prio_destroy(struct Qdisc* sch) | |||
219 | int prio; | 219 | int prio; |
220 | struct prio_sched_data *q = qdisc_priv(sch); | 220 | struct prio_sched_data *q = qdisc_priv(sch); |
221 | 221 | ||
222 | tcf_destroy_chain(q->filter_list); | 222 | tcf_destroy_chain(&q->filter_list); |
223 | for (prio=0; prio<q->bands; prio++) | 223 | for (prio=0; prio<q->bands; prio++) |
224 | qdisc_destroy(q->queues[prio]); | 224 | qdisc_destroy(q->queues[prio]); |
225 | } | 225 | } |
diff --git a/net/sched/sch_sfq.c b/net/sched/sch_sfq.c index f0463d757a9..6a97afbfb95 100644 --- a/net/sched/sch_sfq.c +++ b/net/sched/sch_sfq.c | |||
@@ -520,7 +520,7 @@ static void sfq_destroy(struct Qdisc *sch) | |||
520 | { | 520 | { |
521 | struct sfq_sched_data *q = qdisc_priv(sch); | 521 | struct sfq_sched_data *q = qdisc_priv(sch); |
522 | 522 | ||
523 | tcf_destroy_chain(q->filter_list); | 523 | tcf_destroy_chain(&q->filter_list); |
524 | q->perturb_period = 0; | 524 | q->perturb_period = 0; |
525 | del_timer_sync(&q->perturb_timer); | 525 | del_timer_sync(&q->perturb_timer); |
526 | } | 526 | } |