#include <linux/init.h>
#include <linux/jhash.h>
#include <linux/kernel.h>
#include <linux/kthread.h>
#include <linux/module.h>
#include <linux/rcupdate.h>
#include <linux/rcupdate_wait.h>
#include <linux/rhashtable.h>
#include <linux/slab.h>
#include <linux/sched.h>
#include <linux/random.h>
#include <linux/vmalloc.h>
#include <linux/wait.h>
#define MAX_ENTRIES …
#define TEST_INSERT_FAIL …
static int parm_entries = …;
module_param(parm_entries, int, 0);
MODULE_PARM_DESC(…) …;
static int runs = …;
module_param(runs, int, 0);
MODULE_PARM_DESC(…) …;
static int max_size = …;
module_param(max_size, int, 0);
MODULE_PARM_DESC(…) …;
static bool shrinking = …;
module_param(shrinking, bool, 0);
MODULE_PARM_DESC(…) …;
static int size = …;
module_param(size, int, 0);
MODULE_PARM_DESC(…) …;
static int tcount = …;
module_param(tcount, int, 0);
MODULE_PARM_DESC(…) …;
static bool enomem_retry = …;
module_param(enomem_retry, bool, 0);
MODULE_PARM_DESC(…) …;
struct test_obj_val { … };
struct test_obj { … };
struct test_obj_rhl { … };
struct thread_data { … };
static u32 my_hashfn(const void *data, u32 len, u32 seed)
{ … }
static int my_cmpfn(struct rhashtable_compare_arg *arg, const void *obj)
{ … }
static struct rhashtable_params test_rht_params = …;
static struct rhashtable_params test_rht_params_dup = …;
static atomic_t startup_count;
static DECLARE_WAIT_QUEUE_HEAD(startup_wait);
static int insert_retry(struct rhashtable *ht, struct test_obj *obj,
const struct rhashtable_params params)
{ … }
static int __init test_rht_lookup(struct rhashtable *ht, struct test_obj *array,
unsigned int entries)
{ … }
static void test_bucket_stats(struct rhashtable *ht, unsigned int entries)
{ … }
static s64 __init test_rhashtable(struct rhashtable *ht, struct test_obj *array,
unsigned int entries)
{ … }
static struct rhashtable ht;
static struct rhltable rhlt;
static int __init test_rhltable(unsigned int entries)
{ … }
static int __init test_rhashtable_max(struct test_obj *array,
unsigned int entries)
{ … }
static unsigned int __init print_ht(struct rhltable *rhlt)
{ … }
static int __init test_insert_dup(struct test_obj_rhl *rhl_test_objects,
int cnt, bool slow)
{ … }
static int __init test_insert_duplicates_run(void)
{ … }
static int thread_lookup_test(struct thread_data *tdata)
{ … }
static int threadfunc(void *data)
{ … }
static int __init test_rht_init(void)
{ … }
static void __exit test_rht_exit(void)
{ … }
module_init(…) …;
module_exit(test_rht_exit);
MODULE_DESCRIPTION(…) …;
MODULE_LICENSE(…) …;