![](https://csdnimg.cn/release/download_crawler_static/47255979/bg5.jpg)
*
* This is only for internal list manipulation where we know
* the prev/next entries already!
*/
看不懂此函数可以看下面就明白了, 删除已知节点, 需要知道节点的后继和前趋
static inline void __list_del(struct list_head * prev, struct list_head
* next)
{
next->prev = prev;
prev->next = next;
}
/**
* list_del - deletes entry from list.
* @entry: the element to delete from the list.
* Note: list_empty on entry does not return true after this, the entry
is
* in an undefined state.
*/
static inline void list_del(struct list_head *entry)
{
__list_del(entry->prev, entry->next);
entry->next = LIST_POISON1;
entry->prev = LIST_POISON2;
}
常规的方法是 entry->next 置空,这里做什么为了什么还有待于参考。
/**
* list_del_rcu - deletes entry from list without re-initialization
* @entry: the element to delete from the list.
*
* Note: list_empty on entry does not return true after this,
* the entry is in an undefined state. It is useful for RCU based
* lockfree traversal.
* 注意: list_empty 函数作用在节点后并不返回真,节电处于为定义状态,这对
于 RCU无锁定的遍历状态很有用
* In particular, it means that we can not poison the forward
* pointers that may still be used for walking the list.
* 特别注意,这就意味着我们不能断开前趋指针,前趋指针对遍历链表还是很有
用滴.
* The caller must take whatever precautions are necessary
* (such as holding appropriate locks) to avoid racing