These structures are often seen in the Linux kernel:
struct List_head;
struct Hlist_head;
struct Hlist_node;
These three structures are defined in the Linux kernel source code as follows:
struct List_head
{
struct List_head *prev;
struct List_head *next;
}
struct Hlist_node
{
struct Hlist_node **prev;
struct Hlist_node *next;
}
struct Hlist_head
{
struct Hlist_node *first;
}
The role of these three structures in the kernel:
struct List_head is used to build a doubly linked list in the kernel. This structure is included in the process descriptor struct task_struct of the processes, which is used to make process descriptors in the kernel a process list to manage the processes used in the system.
struct Hlist_head and struct hlist_node are used to build hash lists in the kernel, with the names of these two structures known, the struct hlist_head is used to point to the hash table's head, and the struct hlist_ node is the element in the hash array, which is then hung in a linked list to hold the process descriptor using the same hash index.
This article is from the "FAI Aberdeen" blog, please make sure to keep this source http://weiguozhihui.blog.51cto.com/3060615/1565069
Hlist_head, List_head, Hlist_node structures in the Linux kernel