aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorHerbert Xu <herbert@gondor.apana.org.au>2014-11-13 05:11:22 -0500
committerDavid S. Miller <davem@davemloft.net>2014-11-13 15:13:05 -0500
commit7b4ce2353467fdab6e003be7a3129fb09b09deac (patch)
tree9e5d9d20cf30672d2db081a0de8604ad47680e49 /lib
parent1b2f309d70daf04b6a97b3753e375654532f6207 (diff)
rhashtable: Add parent argument to mutex_is_held
Currently mutex_is_held can only test locks in the that are global since it takes no arguments. This prevents rhashtable from being used in places where locks are lock, e.g., per-namespace locks. This patch adds a parent field to mutex_is_held and rhashtable_params so that local locks can be used (and tested). Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'lib')
-rw-r--r--lib/rhashtable.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/rhashtable.c b/lib/rhashtable.c
index c7654b6f5f64..4b4b53bfa08b 100644
--- a/lib/rhashtable.c
+++ b/lib/rhashtable.c
@@ -32,7 +32,7 @@
32#ifdef CONFIG_PROVE_LOCKING 32#ifdef CONFIG_PROVE_LOCKING
33int lockdep_rht_mutex_is_held(const struct rhashtable *ht) 33int lockdep_rht_mutex_is_held(const struct rhashtable *ht)
34{ 34{
35 return ht->p.mutex_is_held(); 35 return ht->p.mutex_is_held(ht->p.parent);
36} 36}
37EXPORT_SYMBOL_GPL(lockdep_rht_mutex_is_held); 37EXPORT_SYMBOL_GPL(lockdep_rht_mutex_is_held);
38#endif 38#endif
@@ -618,7 +618,7 @@ EXPORT_SYMBOL_GPL(rhashtable_destroy);
618#define TEST_NEXPANDS 4 618#define TEST_NEXPANDS 4
619 619
620#ifdef CONFIG_PROVE_LOCKING 620#ifdef CONFIG_PROVE_LOCKING
621static int test_mutex_is_held(void) 621static int test_mutex_is_held(void *parent)
622{ 622{
623 return 1; 623 return 1;
624} 624}