linux kernel遍历内核的函数
Jump to turn (10)
- User
linux kernel遍历内核的函数
- Assistant
这里列举一些常用的遍历内核的函数:
-
list_for_each:遍历链表
codelist_for_each(pos, head) { // do something with pos }在遍历过程中,pos 为当前遍历的节点,head 为链表的头节点。
-
hlist_for_each:遍历哈希表
codehlist_for_each(pos, head) { // do something with pos }在遍历过程中,pos 为当前遍历的节点,head 为哈希表的头节点。
-
radix_tree_for_each:遍历基数树
coderadix_tree_for_each_slot(slot, tree, &index, 0) { if (slot) // do something with slot->item }在遍历过程中,slot 为当前遍历的节点,tree 为基数树的根节点,index 为遍历的位置。
-