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_atm.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_atm.c')
-rw-r--r-- | net/sched/sch_atm.c | 17 |
1 files changed, 2 insertions, 15 deletions
diff --git a/net/sched/sch_atm.c b/net/sched/sch_atm.c index 0cc3c9b72728..be7d299acd73 100644 --- a/net/sched/sch_atm.c +++ b/net/sched/sch_atm.c | |||
@@ -158,19 +158,6 @@ static unsigned long atm_tc_bind_filter(struct Qdisc *sch, | |||
158 | return atm_tc_get(sch,classid); | 158 | return atm_tc_get(sch,classid); |
159 | } | 159 | } |
160 | 160 | ||
161 | |||
162 | static void destroy_filters(struct atm_flow_data *flow) | ||
163 | { | ||
164 | struct tcf_proto *filter; | ||
165 | |||
166 | while ((filter = flow->filter_list)) { | ||
167 | DPRINTK("destroy_filters: destroying filter %p\n",filter); | ||
168 | flow->filter_list = filter->next; | ||
169 | tcf_destroy(filter); | ||
170 | } | ||
171 | } | ||
172 | |||
173 | |||
174 | /* | 161 | /* |
175 | * atm_tc_put handles all destructions, including the ones that are explicitly | 162 | * atm_tc_put handles all destructions, including the ones that are explicitly |
176 | * requested (atm_tc_destroy, etc.). The assumption here is that we never drop | 163 | * requested (atm_tc_destroy, etc.). The assumption here is that we never drop |
@@ -195,7 +182,7 @@ static void atm_tc_put(struct Qdisc *sch, unsigned long cl) | |||
195 | *prev = flow->next; | 182 | *prev = flow->next; |
196 | DPRINTK("atm_tc_put: qdisc %p\n",flow->q); | 183 | DPRINTK("atm_tc_put: qdisc %p\n",flow->q); |
197 | qdisc_destroy(flow->q); | 184 | qdisc_destroy(flow->q); |
198 | destroy_filters(flow); | 185 | tcf_destroy_chain(flow->filter_list); |
199 | if (flow->sock) { | 186 | if (flow->sock) { |
200 | DPRINTK("atm_tc_put: f_count %d\n", | 187 | DPRINTK("atm_tc_put: f_count %d\n", |
201 | file_count(flow->sock->file)); | 188 | file_count(flow->sock->file)); |
@@ -611,7 +598,7 @@ static void atm_tc_destroy(struct Qdisc *sch) | |||
611 | DPRINTK("atm_tc_destroy(sch %p,[qdisc %p])\n",sch,p); | 598 | DPRINTK("atm_tc_destroy(sch %p,[qdisc %p])\n",sch,p); |
612 | /* races ? */ | 599 | /* races ? */ |
613 | while ((flow = p->flows)) { | 600 | while ((flow = p->flows)) { |
614 | destroy_filters(flow); | 601 | tcf_destroy_chain(flow->filter_list); |
615 | if (flow->ref > 1) | 602 | if (flow->ref > 1) |
616 | printk(KERN_ERR "atm_destroy: %p->ref = %d\n",flow, | 603 | printk(KERN_ERR "atm_destroy: %p->ref = %d\n",flow, |
617 | flow->ref); | 604 | flow->ref); |