]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
netfilter: nft_set_pipapo: move prove_locking helper around
authorFlorian Westphal <fw@strlen.de>
Thu, 25 Apr 2024 12:06:40 +0000 (14:06 +0200)
committerPablo Neira Ayuso <pablo@netfilter.org>
Mon, 6 May 2024 14:29:22 +0000 (16:29 +0200)
Preparation patch, the helper will soon get called from insert
function too.

Signed-off-by: Florian Westphal <fw@strlen.de>
Reviewed-by: Stefano Brivio <sbrivio@redhat.com>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
net/netfilter/nft_set_pipapo.c

index 187138afac45d479f89ea23ec9b09fcd6b6da866..b8205d961ba4f80ffbf3d59a3d3b23ded0f943d4 100644 (file)
@@ -1247,6 +1247,17 @@ static int pipapo_realloc_scratch(struct nft_pipapo_match *clone,
        return 0;
 }
 
+static bool nft_pipapo_transaction_mutex_held(const struct nft_set *set)
+{
+#ifdef CONFIG_PROVE_LOCKING
+       const struct net *net = read_pnet(&set->net);
+
+       return lockdep_is_held(&nft_pernet(net)->commit_mutex);
+#else
+       return true;
+#endif
+}
+
 /**
  * nft_pipapo_insert() - Validate and insert ranged elements
  * @net:       Network namespace
@@ -1799,17 +1810,6 @@ static void nft_pipapo_commit(struct nft_set *set)
        priv->clone = new_clone;
 }
 
-static bool nft_pipapo_transaction_mutex_held(const struct nft_set *set)
-{
-#ifdef CONFIG_PROVE_LOCKING
-       const struct net *net = read_pnet(&set->net);
-
-       return lockdep_is_held(&nft_pernet(net)->commit_mutex);
-#else
-       return true;
-#endif
-}
-
 static void nft_pipapo_abort(const struct nft_set *set)
 {
        struct nft_pipapo *priv = nft_set_priv(set);