]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/blobdiff - net/sched/cls_flower.c
net_sched: move the empty tp check from ->destroy() to ->delete()
[mirror_ubuntu-artful-kernel.git] / net / sched / cls_flower.c
index 3e7bd7801aa8c3a06824f817dc8980c47d1d762b..31ee3404aeb43526dff9e27ce72d6f9097f3ab6c 100644 (file)
@@ -328,21 +328,16 @@ static void fl_destroy_rcu(struct rcu_head *rcu)
        schedule_work(&head->work);
 }
 
-static bool fl_destroy(struct tcf_proto *tp, bool force)
+static void fl_destroy(struct tcf_proto *tp)
 {
        struct cls_fl_head *head = rtnl_dereference(tp->root);
        struct cls_fl_filter *f, *next;
 
-       if (!force && !list_empty(&head->filters))
-               return false;
-
        list_for_each_entry_safe(f, next, &head->filters, list)
                __fl_delete(tp, f);
 
        __module_get(THIS_MODULE);
        call_rcu(&head->rcu, fl_destroy_rcu);
-
-       return true;
 }
 
 static unsigned long fl_get(struct tcf_proto *tp, u32 handle)
@@ -947,7 +942,7 @@ errout_tb:
        return err;
 }
 
-static int fl_delete(struct tcf_proto *tp, unsigned long arg)
+static int fl_delete(struct tcf_proto *tp, unsigned long arg, bool *last)
 {
        struct cls_fl_head *head = rtnl_dereference(tp->root);
        struct cls_fl_filter *f = (struct cls_fl_filter *) arg;
@@ -956,6 +951,7 @@ static int fl_delete(struct tcf_proto *tp, unsigned long arg)
                rhashtable_remove_fast(&head->ht, &f->ht_node,
                                       head->ht_params);
        __fl_delete(tp, f);
+       *last = list_empty(&head->filters);
        return 0;
 }