list_del_init Prev Doubly Linked Lists NextName list_del_init — deletes entry from list and reinitialize it. Synopsis void list_del_init ( struct list_head * entry); Arguments entry the element to delete from the list. Prev Up Next list_replace_rcu Home list_move
list_del 只是简单的调用__list_del函数。然后将prev、next指针分别被设为LIST_POSITION2和LIST_POSITION1两个特殊值,对LIST_POSITION1和LIST_POSITION2的访问都将引起页故障,它属于不安全的删除。list_del_init属于安全删除
plist_del从plist移除节点 kobj_kset_leavemove the kobject from its kset's list test_update_node shadow_remove module_unload_ei_list ddebug_table_free sbitmap_del_wait_queue list_test_list_del_init arch_optimize_kprobesReplace breakpoints (int3) with relative jumps.* Caller must call with lo...
inlinevoidlist_del(structlist_head *entry);inlinevoidlist_del_init(structlist_head *entry); 其中list_del_init在删除节点后还对该节点重新进行初始化操作。 2.5 — 从链表中替换节点 和删除节点同理,替换节点也只是修改了prev和next指针指向,并且list_replace_init还会对替换出来的节点(old)进行重新初始化...
本文从最基本的内核链表出发,引出初始化INIT_LIST_HEAD函数,然后介绍list_add,通过改变链表位置的问题引出list_for_each函数,然后为了获取容器结构地址,引出offsetof和container_of宏,并对内核链表设计原因作出了解释,一步步引导到list_for_each_entry,然后介绍list_del函数,通过在遍历时list_del链表的不安全行为,引出li...
static inline bool __list_del_entry_valid(struct list_head *entry) { return true; } static inline void __list_del(struct list_head * prev, struct list_head * next) { next->prev = prev; WRITE_ONCE(prev->next, next); } 2.4list_del_init ...
与之相对应,list_del_init()函数将节点从链表中解下来之后,调用LIST_INIT_HEAD()将节点置为空链状态。 c) 搬移 Linux提供了将原本属于一个链表的节点移动到另一个链表的操作,并根据插入到新链表的位置分为两类: static inline voidlist_move(struct list_head *list, struct list_head *head);...
(1)list_del 删除链表中的一个结点。 (2)list_del_init 删除链表中的一个结点,并初始化被删除的结点(使被删除的结点的prev和next都指向自己); 分别看它们的定义: 1staticinlinevoidlist_del(structlist_head *entry)2{3__list_del(entry->prev, entry->next);4entry->next =LIST_POISON1;5entry->prev...
@@ -315,7 +297,7 @@ static inline void list_del_init_careful(struct list_head *entry) */ static inline int list_empty_careful(const struct list_head *head) { struct list_head *next = smp_load_acquire(&head->next); struct list_head *next = head->next; ...
staticinlinevoidhlist_del(structhlist_node *n) { __hlist_del(n); n->next =LIST_POISON1; n->pprev =LIST_POISON2; } 在用户态程序中,我们一般通过判断指针是不是是null来判断能否使用这个指针,在将一个entry从list删除后,一般将prev和next设置为NULL,这样做没有什么问题,但是这样就没有 ...