Merge branch 'core-rcu-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git...
[linux-2.6-block.git] / net / sched / act_police.c
index 981a9eca0c524ac7a18c98630c0bc7d087fadfdc..8b7a0ac96c5169e833c6f87898c6503a49c726af 100644 (file)
@@ -47,7 +47,7 @@ static const struct nla_policy police_policy[TCA_POLICE_MAX + 1] = {
 static int tcf_police_init(struct net *net, struct nlattr *nla,
                               struct nlattr *est, struct tc_action **a,
                               int ovr, int bind, bool rtnl_held,
-                              struct tcf_proto *tp,
+                              struct tcf_proto *tp, u32 flags,
                               struct netlink_ext_ack *extack)
 {
        int ret = 0, tcfp_result = TC_ACT_OK, err, size;
@@ -87,7 +87,7 @@ static int tcf_police_init(struct net *net, struct nlattr *nla,
 
        if (!exists) {
                ret = tcf_idr_create(tn, index, NULL, a,
-                                    &act_police_ops, bind, true);
+                                    &act_police_ops, bind, true, 0);
                if (ret) {
                        tcf_idr_cleanup(tn, index);
                        return ret;
@@ -191,9 +191,9 @@ static int tcf_police_init(struct net *net, struct nlattr *nla,
                police->tcfp_ptoks = new->tcfp_mtu_ptoks;
        spin_unlock_bh(&police->tcfp_lock);
        goto_ch = tcf_action_set_ctrlact(*a, parm->action, goto_ch);
-       rcu_swap_protected(police->params,
-                          new,
-                          lockdep_is_held(&police->tcf_lock));
+       new = rcu_replace_pointer(police->params,
+                                 new,
+                                 lockdep_is_held(&police->tcf_lock));
        spin_unlock_bh(&police->tcf_lock);
 
        if (goto_ch)
@@ -294,10 +294,7 @@ static void tcf_police_stats_update(struct tc_action *a,
        struct tcf_police *police = to_police(a);
        struct tcf_t *tm = &police->tcf_tm;
 
-       _bstats_cpu_update(this_cpu_ptr(a->cpu_bstats), bytes, packets);
-       if (hw)
-               _bstats_cpu_update(this_cpu_ptr(a->cpu_bstats_hw),
-                                  bytes, packets);
+       tcf_action_update_stats(a, bytes, packets, false, hw);
        tm->lastuse = max_t(u64, tm->lastuse, lastuse);
 }