The rhashtable function mutex_is_held is only used when PROVE_LOCKING
is enabled. This patch makes the mutex_is_held field in rhashtable
optional depending on PROVE_LOCKING.
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: David S. Miller <davem@davemloft.net>
size_t new_size);
bool (*shrink_decision)(const struct rhashtable *ht,
size_t new_size);
size_t new_size);
bool (*shrink_decision)(const struct rhashtable *ht,
size_t new_size);
+#ifdef CONFIG_PROVE_LOCKING
int (*mutex_is_held)(void);
int (*mutex_is_held)(void);
* .key_offset = offsetof(struct test_obj, key),
* .key_len = sizeof(int),
* .hashfn = arch_fast_hash,
* .key_offset = offsetof(struct test_obj, key),
* .key_len = sizeof(int),
* .hashfn = arch_fast_hash,
+ * #ifdef CONFIG_PROVE_LOCKING
* .mutex_is_held = &my_mutex_is_held,
* .mutex_is_held = &my_mutex_is_held,
* };
*
* Configuration Example 2: Variable length keys
* };
*
* Configuration Example 2: Variable length keys
* .head_offset = offsetof(struct test_obj, node),
* .hashfn = arch_fast_hash,
* .obj_hashfn = my_hash_fn,
* .head_offset = offsetof(struct test_obj, node),
* .hashfn = arch_fast_hash,
* .obj_hashfn = my_hash_fn,
+ * #ifdef CONFIG_PROVE_LOCKING
* .mutex_is_held = &my_mutex_is_held,
* .mutex_is_held = &my_mutex_is_held,
* };
*/
int rhashtable_init(struct rhashtable *ht, struct rhashtable_params *params)
* };
*/
int rhashtable_init(struct rhashtable *ht, struct rhashtable_params *params)
#define TEST_PTR ((void *) 0xdeadbeef)
#define TEST_NEXPANDS 4
#define TEST_PTR ((void *) 0xdeadbeef)
#define TEST_NEXPANDS 4
+#ifdef CONFIG_PROVE_LOCKING
static int test_mutex_is_held(void)
{
return 1;
}
static int test_mutex_is_held(void)
{
return 1;
}
struct test_obj {
void *ptr;
struct test_obj {
void *ptr;
.key_offset = offsetof(struct test_obj, value),
.key_len = sizeof(int),
.hashfn = arch_fast_hash,
.key_offset = offsetof(struct test_obj, value),
.key_len = sizeof(int),
.hashfn = arch_fast_hash,
+#ifdef CONFIG_PROVE_LOCKING
.mutex_is_held = &test_mutex_is_held,
.mutex_is_held = &test_mutex_is_held,
.grow_decision = rht_grow_above_75,
.shrink_decision = rht_shrink_below_30,
};
.grow_decision = rht_grow_above_75,
.shrink_decision = rht_shrink_below_30,
};