summaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorWei Yongjun <weiyongjun1@huawei.com>2017-11-14 06:27:12 +0000
committerDavid S. Miller <davem@davemloft.net>2017-11-14 22:02:08 +0900
commit6dc14dc40a1d1dafd8491c349b5f3e15aabc4edb (patch)
tree35f12077fe9da376dc55d426756f74b10c3ad36a /net
parent06c2351fdebb38803f10ace19ed8daf9b9c91e12 (diff)
downloadlinux-6dc14dc40a1d1dafd8491c349b5f3e15aabc4edb.tar.bz2
openvswitch: Using kfree_rcu() to simplify the code
The callback function of call_rcu() just calls a kfree(), so we can use kfree_rcu() instead of call_rcu() + callback function. Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com> Acked-by: Pravin B Shelar <pshelar@ovn.org> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net')
-rw-r--r--net/openvswitch/meter.c9
1 files changed, 1 insertions, 8 deletions
diff --git a/net/openvswitch/meter.c b/net/openvswitch/meter.c
index 2e58b6c4c65f..52ddd6c408b3 100644
--- a/net/openvswitch/meter.c
+++ b/net/openvswitch/meter.c
@@ -42,19 +42,12 @@ static const struct nla_policy band_policy[OVS_BAND_ATTR_MAX + 1] = {
[OVS_BAND_ATTR_STATS] = { .len = sizeof(struct ovs_flow_stats) },
};
-static void rcu_free_ovs_meter_callback(struct rcu_head *rcu)
-{
- struct dp_meter *meter = container_of(rcu, struct dp_meter, rcu);
-
- kfree(meter);
-}
-
static void ovs_meter_free(struct dp_meter *meter)
{
if (!meter)
return;
- call_rcu(&meter->rcu, rcu_free_ovs_meter_callback);
+ kfree_rcu(meter, rcu);
}
static struct hlist_head *meter_hash_bucket(const struct datapath *dp,