i came across a struct in “linux/list.h” such as shown below. I don’t completely understand it or how it can be used? It seems to be some sort of marker structure as it declare any variable to contain any information, other than empty itself. How would you use it?
struct list_head {
struct list_head *next, *prev;
};
Yes, a linked list without data elements seems strange. But, did you try searching for usages of the struct in other headers?
I am guessing they will use this struct in other structures which need a linked list, like say the buffer free list etc. You will find the data elements there.