diff options
Diffstat (limited to 'net/sched/cls_basic.c')
-rw-r--r-- | net/sched/cls_basic.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/net/sched/cls_basic.c b/net/sched/cls_basic.c index 422414f16b38..c4fd63a068f9 100644 --- a/net/sched/cls_basic.c +++ b/net/sched/cls_basic.c | |||
@@ -93,30 +93,28 @@ static void basic_delete_filter(struct rcu_head *head) | |||
93 | kfree(f); | 93 | kfree(f); |
94 | } | 94 | } |
95 | 95 | ||
96 | static bool basic_destroy(struct tcf_proto *tp, bool force) | 96 | static void basic_destroy(struct tcf_proto *tp) |
97 | { | 97 | { |
98 | struct basic_head *head = rtnl_dereference(tp->root); | 98 | struct basic_head *head = rtnl_dereference(tp->root); |
99 | struct basic_filter *f, *n; | 99 | struct basic_filter *f, *n; |
100 | 100 | ||
101 | if (!force && !list_empty(&head->flist)) | ||
102 | return false; | ||
103 | |||
104 | list_for_each_entry_safe(f, n, &head->flist, link) { | 101 | list_for_each_entry_safe(f, n, &head->flist, link) { |
105 | list_del_rcu(&f->link); | 102 | list_del_rcu(&f->link); |
106 | tcf_unbind_filter(tp, &f->res); | 103 | tcf_unbind_filter(tp, &f->res); |
107 | call_rcu(&f->rcu, basic_delete_filter); | 104 | call_rcu(&f->rcu, basic_delete_filter); |
108 | } | 105 | } |
109 | kfree_rcu(head, rcu); | 106 | kfree_rcu(head, rcu); |
110 | return true; | ||
111 | } | 107 | } |
112 | 108 | ||
113 | static int basic_delete(struct tcf_proto *tp, unsigned long arg) | 109 | static int basic_delete(struct tcf_proto *tp, unsigned long arg, bool *last) |
114 | { | 110 | { |
111 | struct basic_head *head = rtnl_dereference(tp->root); | ||
115 | struct basic_filter *f = (struct basic_filter *) arg; | 112 | struct basic_filter *f = (struct basic_filter *) arg; |
116 | 113 | ||
117 | list_del_rcu(&f->link); | 114 | list_del_rcu(&f->link); |
118 | tcf_unbind_filter(tp, &f->res); | 115 | tcf_unbind_filter(tp, &f->res); |
119 | call_rcu(&f->rcu, basic_delete_filter); | 116 | call_rcu(&f->rcu, basic_delete_filter); |
117 | *last = list_empty(&head->flist); | ||
120 | return 0; | 118 | return 0; |
121 | } | 119 | } |
122 | 120 | ||