Skip to content

Commit

Permalink
netfilter: Move mutex_is_held under PROVE_LOCKING
Browse files Browse the repository at this point in the history
The rhashtable function mutex_is_held is only used when PROVE_LOCKING
is enabled.  This patch modifies netfilter so that we can rhashtable.h
itself can later make mutex_is_held optional depending on PROVE_LOCKING.

Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Herbert Xu authored and David S. Miller committed Nov 13, 2014
1 parent 9712756 commit 1f501d6
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions net/netfilter/nft_hash.c
Original file line number Diff line number Diff line change
Expand Up @@ -153,10 +153,12 @@ static unsigned int nft_hash_privsize(const struct nlattr * const nla[])
return sizeof(struct rhashtable);
}

#ifdef CONFIG_PROVE_LOCKING
static int lockdep_nfnl_lock_is_held(void)
{
return lockdep_nfnl_is_held(NFNL_SUBSYS_NFTABLES);
}
#endif

static int nft_hash_init(const struct nft_set *set,
const struct nft_set_desc *desc,
Expand All @@ -171,7 +173,9 @@ static int nft_hash_init(const struct nft_set *set,
.hashfn = jhash,
.grow_decision = rht_grow_above_75,
.shrink_decision = rht_shrink_below_30,
#ifdef CONFIG_PROVE_LOCKING
.mutex_is_held = lockdep_nfnl_lock_is_held,
#endif
};

return rhashtable_init(priv, &params);
Expand Down

0 comments on commit 1f501d6

Please sign in to comment.