Commit a2d88182 authored by Taehee Yoo's avatar Taehee Yoo Committed by Pablo Neira Ayuso

netfilter: nf_tables: use rhashtable_lookup() instead of rhashtable_lookup_fast()

Internally, rhashtable_lookup_fast() calls rcu_read_lock() then,
calls rhashtable_lookup(). so that in places where are guaranteed
by rcu read lock, rhashtable_lookup() is enough.
Signed-off-by: default avatarTaehee Yoo <ap420073@gmail.com>
Signed-off-by: default avatarPablo Neira Ayuso <pablo@netfilter.org>
parent 28c5ed2f
...@@ -233,8 +233,8 @@ flow_offload_lookup(struct nf_flowtable *flow_table, ...@@ -233,8 +233,8 @@ flow_offload_lookup(struct nf_flowtable *flow_table,
struct flow_offload *flow; struct flow_offload *flow;
int dir; int dir;
tuplehash = rhashtable_lookup_fast(&flow_table->rhashtable, tuple, tuplehash = rhashtable_lookup(&flow_table->rhashtable, tuple,
nf_flow_offload_rhash_params); nf_flow_offload_rhash_params);
if (!tuplehash) if (!tuplehash)
return NULL; return NULL;
......
...@@ -88,7 +88,7 @@ static bool nft_rhash_lookup(const struct net *net, const struct nft_set *set, ...@@ -88,7 +88,7 @@ static bool nft_rhash_lookup(const struct net *net, const struct nft_set *set,
.key = key, .key = key,
}; };
he = rhashtable_lookup_fast(&priv->ht, &arg, nft_rhash_params); he = rhashtable_lookup(&priv->ht, &arg, nft_rhash_params);
if (he != NULL) if (he != NULL)
*ext = &he->ext; *ext = &he->ext;
...@@ -106,7 +106,7 @@ static void *nft_rhash_get(const struct net *net, const struct nft_set *set, ...@@ -106,7 +106,7 @@ static void *nft_rhash_get(const struct net *net, const struct nft_set *set,
.key = elem->key.val.data, .key = elem->key.val.data,
}; };
he = rhashtable_lookup_fast(&priv->ht, &arg, nft_rhash_params); he = rhashtable_lookup(&priv->ht, &arg, nft_rhash_params);
if (he != NULL) if (he != NULL)
return he; return he;
...@@ -129,7 +129,7 @@ static bool nft_rhash_update(struct nft_set *set, const u32 *key, ...@@ -129,7 +129,7 @@ static bool nft_rhash_update(struct nft_set *set, const u32 *key,
.key = key, .key = key,
}; };
he = rhashtable_lookup_fast(&priv->ht, &arg, nft_rhash_params); he = rhashtable_lookup(&priv->ht, &arg, nft_rhash_params);
if (he != NULL) if (he != NULL)
goto out; goto out;
...@@ -217,7 +217,7 @@ static void *nft_rhash_deactivate(const struct net *net, ...@@ -217,7 +217,7 @@ static void *nft_rhash_deactivate(const struct net *net,
}; };
rcu_read_lock(); rcu_read_lock();
he = rhashtable_lookup_fast(&priv->ht, &arg, nft_rhash_params); he = rhashtable_lookup(&priv->ht, &arg, nft_rhash_params);
if (he != NULL && if (he != NULL &&
!nft_rhash_flush(net, set, he)) !nft_rhash_flush(net, set, he))
he = NULL; he = NULL;
......
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