list_head这东西,看名字就是个联表头,可确确实实是链表节点。
struct list_head{
struct list_head *next,*prev;
};
里面就俩成员,一个指向前面,一个指向后面。
使用得时候,将此节点包在其他结构体内,就可通过list_head链表将包含它的节点串起来。
linux内核提供container_of(pointer, type,member)宏,type是个结构体类型,member是type成员得类型,pointer是member得指针。宏返回指向type得指针。
其他函数待添加。。。