Commit 1ba1c414 authored by Pablo Neira Ayuso's avatar Pablo Neira Ayuso

netfilter: nf_tables: rename deactivate_one() to flush()

Although semantics are similar to deactivate() with no implicit element
lookup, this is only called from the set flush path, so better rename
this to flush().
Signed-off-by: default avatarPablo Neira Ayuso <pablo@netfilter.org>
parent baa2d42c
...@@ -260,7 +260,7 @@ struct nft_expr; ...@@ -260,7 +260,7 @@ struct nft_expr;
* @insert: insert new element into set * @insert: insert new element into set
* @activate: activate new element in the next generation * @activate: activate new element in the next generation
* @deactivate: lookup for element and deactivate it in the next generation * @deactivate: lookup for element and deactivate it in the next generation
* @deactivate_one: deactivate element in the next generation * @flush: deactivate element in the next generation
* @remove: remove element from set * @remove: remove element from set
* @walk: iterate over all set elemeennts * @walk: iterate over all set elemeennts
* @privsize: function to return size of set private data * @privsize: function to return size of set private data
...@@ -295,9 +295,9 @@ struct nft_set_ops { ...@@ -295,9 +295,9 @@ struct nft_set_ops {
void * (*deactivate)(const struct net *net, void * (*deactivate)(const struct net *net,
const struct nft_set *set, const struct nft_set *set,
const struct nft_set_elem *elem); const struct nft_set_elem *elem);
bool (*deactivate_one)(const struct net *net, bool (*flush)(const struct net *net,
const struct nft_set *set, const struct nft_set *set,
void *priv); void *priv);
void (*remove)(const struct net *net, void (*remove)(const struct net *net,
const struct nft_set *set, const struct nft_set *set,
const struct nft_set_elem *elem); const struct nft_set_elem *elem);
......
...@@ -3898,7 +3898,7 @@ static int nft_flush_set(const struct nft_ctx *ctx, ...@@ -3898,7 +3898,7 @@ static int nft_flush_set(const struct nft_ctx *ctx,
if (!trans) if (!trans)
return -ENOMEM; return -ENOMEM;
if (!set->ops->deactivate_one(ctx->net, set, elem->priv)) { if (!set->ops->flush(ctx->net, set, elem->priv)) {
err = -ENOENT; err = -ENOENT;
goto err1; goto err1;
} }
......
...@@ -167,8 +167,8 @@ static void nft_hash_activate(const struct net *net, const struct nft_set *set, ...@@ -167,8 +167,8 @@ static void nft_hash_activate(const struct net *net, const struct nft_set *set,
nft_set_elem_clear_busy(&he->ext); nft_set_elem_clear_busy(&he->ext);
} }
static bool nft_hash_deactivate_one(const struct net *net, static bool nft_hash_flush(const struct net *net,
const struct nft_set *set, void *priv) const struct nft_set *set, void *priv)
{ {
struct nft_hash_elem *he = priv; struct nft_hash_elem *he = priv;
...@@ -195,7 +195,7 @@ static void *nft_hash_deactivate(const struct net *net, ...@@ -195,7 +195,7 @@ static void *nft_hash_deactivate(const struct net *net,
rcu_read_lock(); rcu_read_lock();
he = rhashtable_lookup_fast(&priv->ht, &arg, nft_hash_params); he = rhashtable_lookup_fast(&priv->ht, &arg, nft_hash_params);
if (he != NULL && if (he != NULL &&
!nft_hash_deactivate_one(net, set, he)) !nft_hash_flush(net, set, he))
he = NULL; he = NULL;
rcu_read_unlock(); rcu_read_unlock();
...@@ -398,7 +398,7 @@ static struct nft_set_ops nft_hash_ops __read_mostly = { ...@@ -398,7 +398,7 @@ static struct nft_set_ops nft_hash_ops __read_mostly = {
.insert = nft_hash_insert, .insert = nft_hash_insert,
.activate = nft_hash_activate, .activate = nft_hash_activate,
.deactivate = nft_hash_deactivate, .deactivate = nft_hash_deactivate,
.deactivate_one = nft_hash_deactivate_one, .flush = nft_hash_flush,
.remove = nft_hash_remove, .remove = nft_hash_remove,
.lookup = nft_hash_lookup, .lookup = nft_hash_lookup,
.update = nft_hash_update, .update = nft_hash_update,
......
...@@ -172,8 +172,8 @@ static void nft_rbtree_activate(const struct net *net, ...@@ -172,8 +172,8 @@ static void nft_rbtree_activate(const struct net *net,
nft_set_elem_change_active(net, set, &rbe->ext); nft_set_elem_change_active(net, set, &rbe->ext);
} }
static bool nft_rbtree_deactivate_one(const struct net *net, static bool nft_rbtree_flush(const struct net *net,
const struct nft_set *set, void *priv) const struct nft_set *set, void *priv)
{ {
struct nft_rbtree_elem *rbe = priv; struct nft_rbtree_elem *rbe = priv;
...@@ -214,7 +214,7 @@ static void *nft_rbtree_deactivate(const struct net *net, ...@@ -214,7 +214,7 @@ static void *nft_rbtree_deactivate(const struct net *net,
parent = parent->rb_right; parent = parent->rb_right;
continue; continue;
} }
nft_rbtree_deactivate_one(net, set, rbe); nft_rbtree_flush(net, set, rbe);
return rbe; return rbe;
} }
} }
...@@ -305,7 +305,7 @@ static struct nft_set_ops nft_rbtree_ops __read_mostly = { ...@@ -305,7 +305,7 @@ static struct nft_set_ops nft_rbtree_ops __read_mostly = {
.insert = nft_rbtree_insert, .insert = nft_rbtree_insert,
.remove = nft_rbtree_remove, .remove = nft_rbtree_remove,
.deactivate = nft_rbtree_deactivate, .deactivate = nft_rbtree_deactivate,
.deactivate_one = nft_rbtree_deactivate_one, .flush = nft_rbtree_flush,
.activate = nft_rbtree_activate, .activate = nft_rbtree_activate,
.lookup = nft_rbtree_lookup, .lookup = nft_rbtree_lookup,
.walk = nft_rbtree_walk, .walk = nft_rbtree_walk,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment