I'm trying to understand the lock-less list in the Linux kernel. This is defined in llist.h. Why do they have two structs, to define a list:
struct llist_head {
struct llist_node *first;
};
struct llist_node {
struct llist_node *next;
};
Why not have just one struct that has a pointer to the next node? It would similar to the doubly linked list implementation in the kernel.