Skip to content

Commit a590f47

Browse files
Florian Westphalummakynes
authored andcommitted
netfilter: nft_set_pipapo: move prove_locking helper around
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>
1 parent 119c790 commit a590f47

1 file changed

Lines changed: 11 additions & 11 deletions

File tree

net/netfilter/nft_set_pipapo.c

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1247,6 +1247,17 @@ static int pipapo_realloc_scratch(struct nft_pipapo_match *clone,
12471247
return 0;
12481248
}
12491249

1250+
static bool nft_pipapo_transaction_mutex_held(const struct nft_set *set)
1251+
{
1252+
#ifdef CONFIG_PROVE_LOCKING
1253+
const struct net *net = read_pnet(&set->net);
1254+
1255+
return lockdep_is_held(&nft_pernet(net)->commit_mutex);
1256+
#else
1257+
return true;
1258+
#endif
1259+
}
1260+
12501261
/**
12511262
* nft_pipapo_insert() - Validate and insert ranged elements
12521263
* @net: Network namespace
@@ -1799,17 +1810,6 @@ static void nft_pipapo_commit(struct nft_set *set)
17991810
priv->clone = new_clone;
18001811
}
18011812

1802-
static bool nft_pipapo_transaction_mutex_held(const struct nft_set *set)
1803-
{
1804-
#ifdef CONFIG_PROVE_LOCKING
1805-
const struct net *net = read_pnet(&set->net);
1806-
1807-
return lockdep_is_held(&nft_pernet(net)->commit_mutex);
1808-
#else
1809-
return true;
1810-
#endif
1811-
}
1812-
18131813
static void nft_pipapo_abort(const struct nft_set *set)
18141814
{
18151815
struct nft_pipapo *priv = nft_set_priv(set);

0 commit comments

Comments
 (0)