As for kernel lists, Linux offers to kernel developers a common interface to manage hash tables. Their implementation is based on a special version of the kernel lists seen in the preceding section and named hlist (which is still a doubly linked list but with a single pointer list head). This API is defined in the header file, linux/include/linux/hashtable.h.
In this recipe, we will show how we can use hash tables in our kernel code by using the Linux API.