]> git.proxmox.com Git - mirror_ubuntu-hirsute-kernel.git/blobdiff - net/sched/cls_matchall.c
net_sched: switch to rcu_work
[mirror_ubuntu-hirsute-kernel.git] / net / sched / cls_matchall.c
index 2ba721a590a72a9fbaa3d92a18b9db7558b54869..47b207ef77620f8baa530a8bc8c44c35ecf2df78 100644 (file)
@@ -21,10 +21,7 @@ struct cls_mall_head {
        struct tcf_result res;
        u32 handle;
        u32 flags;
-       union {
-               struct work_struct work;
-               struct rcu_head rcu;
-       };
+       struct rcu_work rwork;
 };
 
 static int mall_classify(struct sk_buff *skb, const struct tcf_proto *tp,
@@ -53,22 +50,14 @@ static void __mall_destroy(struct cls_mall_head *head)
 
 static void mall_destroy_work(struct work_struct *work)
 {
-       struct cls_mall_head *head = container_of(work, struct cls_mall_head,
-                                                 work);
+       struct cls_mall_head *head = container_of(to_rcu_work(work),
+                                                 struct cls_mall_head,
+                                                 rwork);
        rtnl_lock();
        __mall_destroy(head);
        rtnl_unlock();
 }
 
-static void mall_destroy_rcu(struct rcu_head *rcu)
-{
-       struct cls_mall_head *head = container_of(rcu, struct cls_mall_head,
-                                                 rcu);
-
-       INIT_WORK(&head->work, mall_destroy_work);
-       tcf_queue_work(&head->work);
-}
-
 static void mall_destroy_hw_filter(struct tcf_proto *tp,
                                   struct cls_mall_head *head,
                                   unsigned long cookie,
@@ -126,7 +115,7 @@ static void mall_destroy(struct tcf_proto *tp, struct netlink_ext_ack *extack)
                mall_destroy_hw_filter(tp, head, (unsigned long) head, extack);
 
        if (tcf_exts_get_net(&head->exts))
-               call_rcu(&head->rcu, mall_destroy_rcu);
+               tcf_queue_work(&head->rwork, mall_destroy_work);
        else
                __mall_destroy(head);
 }