@@ -275,14 +275,6 @@ bool nf_conncount_gc_list(struct net *net,
}
EXPORT_SYMBOL_GPL(nf_conncount_gc_list);
-static void __tree_nodes_free(struct rcu_head *h)
-{
- struct nf_conncount_rb *rbconn;
-
- rbconn = container_of(h, struct nf_conncount_rb, rcu_head);
- kmem_cache_free(conncount_rb_cachep, rbconn);
-}
-
/* caller must hold tree nf_conncount_locks[] lock */
static void tree_nodes_free(struct rb_root *root,
struct nf_conncount_rb *gc_nodes[],
@@ -295,7 +287,7 @@ static void tree_nodes_free(struct rb_root *root,
spin_lock(&rbconn->list.list_lock);
if (!rbconn->list.count) {
rb_erase(&rbconn->node, root);
- call_rcu(&rbconn->rcu_head, __tree_nodes_free);
+ kfree_rcu(rbconn, rcu_head);
}
spin_unlock(&rbconn->list.list_lock);
}
@@ -367,18 +367,10 @@ void nf_ct_expect_init(struct nf_conntrack_expect *exp, unsigned int class,
}
EXPORT_SYMBOL_GPL(nf_ct_expect_init);
-static void nf_ct_expect_free_rcu(struct rcu_head *head)
-{
- struct nf_conntrack_expect *exp;
-
- exp = container_of(head, struct nf_conntrack_expect, rcu);
- kmem_cache_free(nf_ct_expect_cachep, exp);
-}
-
void nf_ct_expect_put(struct nf_conntrack_expect *exp)
{
if (refcount_dec_and_test(&exp->use))
- call_rcu(&exp->rcu, nf_ct_expect_free_rcu);
+ kfree_rcu(exp, rcu);
}
EXPORT_SYMBOL_GPL(nf_ct_expect_put);
@@ -256,18 +256,11 @@ dsthash_alloc_init(struct xt_hashlimit_htable *ht,
return ent;
}
-static void dsthash_free_rcu(struct rcu_head *head)
-{
- struct dsthash_ent *ent = container_of(head, struct dsthash_ent, rcu);
-
- kmem_cache_free(hashlimit_cachep, ent);
-}
-
static inline void
dsthash_free(struct xt_hashlimit_htable *ht, struct dsthash_ent *ent)
{
hlist_del_rcu(&ent->node);
- call_rcu(&ent->rcu, dsthash_free_rcu);
+ kfree_rcu(ent, rcu);
ht->count--;
}
static void htable_gc(struct work_struct *work);