net_sched: destroy proto tp when all filters are gone
[deliverable/linux.git] / net / sched / cls_tcindex.c
index bd49bf547a479f139b25e0507b090d51c137c519..a557dbaf5afedaa7a3a3a18c53a83238f6d32420 100644 (file)
@@ -468,11 +468,14 @@ static void tcindex_walk(struct tcf_proto *tp, struct tcf_walker *walker)
        }
 }
 
-static void tcindex_destroy(struct tcf_proto *tp)
+static bool tcindex_destroy(struct tcf_proto *tp, bool force)
 {
        struct tcindex_data *p = rtnl_dereference(tp->root);
        struct tcf_walker walker;
 
+       if (!force)
+               return false;
+
        pr_debug("tcindex_destroy(tp %p),p %p\n", tp, p);
        walker.count = 0;
        walker.skip = 0;
@@ -481,6 +484,7 @@ static void tcindex_destroy(struct tcf_proto *tp)
 
        RCU_INIT_POINTER(tp->root, NULL);
        call_rcu(&p->rcu, __tcindex_destroy);
+       return true;
 }
 
 
This page took 0.025371 seconds and 5 git commands to generate.