List Handling in Linux Kernel Development
If you want to get a brief information about how to use Linux's linked list data structure, please see the below sample code. You can check-out the code from the github location, build and run on your own Linux development environment. /* * my_object structure. */ struct my_object { int data; struct list_head list; }; /* * list_init() */ static int list_init ( void ) { struct my_object *tmp; /* Temporary object created for each list member */ struct my_object obj_list; /* List constructed with the tmp objects */ struct list_head *pos, *n; /* Position pointers in the list */ int i; printk(KERN_INFO "list init \n " ); /* * Initialize the list object. This object is used only as the * head of the list. It doesn't have any data in it. */ INIT_LIST_HEAD(&obj_list.li...