将prev和next之间的list_head从链表中删除:
+--prev next--+
| |
| list_head list_head | list_head
| |---------------| |---------------| | |---------------|
+->|list_head *next|--->|list_head *next|-+->|list_head *next|
|---------------| |---------------| |---------------|
|list_head *prev|<---|list_head *prev|<---|list_head *prev|
|---------------| |---------------| |---------------|
+--------------------+
| |
list_head | list_head | list_head
|---------------| | |---------------| | |---------------|
|list_head *next|-+ |list_head *next|-+->|list_head *next|
|---------------| |---------------| |---------------|
|list_head *prev|<-+-|list_head *prev| +--|list_head *prev|
|---------------| | |---------------| | |---------------|
| |
+-------------------+
static
inline
void
__list_del(
struct
list_head
*
prev,
struct
list_head
*
next)
{
next->prev = prev;
prev->next = next;
}
{
next->prev = prev;
prev->next = next;
}
+--prev next--+
| |
| list_head list_head | list_head
| |---------------| |---------------| | |---------------|
+->|list_head *next|--->|list_head *next|-+->|list_head *next|
|---------------| |---------------| |---------------|
|list_head *prev|<---|list_head *prev|<---|list_head *prev|
|---------------| |---------------| |---------------|
+--------------------+
| |
list_head | list_head | list_head
|---------------| | |---------------| | |---------------|
|list_head *next|-+ |list_head *next|-+->|list_head *next|
|---------------| |---------------| |---------------|
|list_head *prev|<-+-|list_head *prev| +--|list_head *prev|
|---------------| | |---------------| | |---------------|
| |
+-------------------+