diff options
-rw-r--r-- | include/linux/list.h | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/include/linux/list.h b/include/linux/list.h index 8e3388284530..945daa1f13dd 100644 --- a/include/linux/list.h +++ b/include/linux/list.h | |||
@@ -436,6 +436,20 @@ static inline void list_splice_init(struct list_head *list, | |||
436 | pos = n, n = list_entry(n->member.next, typeof(*n), member)) | 436 | pos = n, n = list_entry(n->member.next, typeof(*n), member)) |
437 | 437 | ||
438 | /** | 438 | /** |
439 | * list_for_each_entry_safe_reverse - iterate backwards over list of given type safe against | ||
440 | * removal of list entry | ||
441 | * @pos: the type * to use as a loop counter. | ||
442 | * @n: another type * to use as temporary storage | ||
443 | * @head: the head for your list. | ||
444 | * @member: the name of the list_struct within the struct. | ||
445 | */ | ||
446 | #define list_for_each_entry_safe_reverse(pos, n, head, member) \ | ||
447 | for (pos = list_entry((head)->prev, typeof(*pos), member), \ | ||
448 | n = list_entry(pos->member.prev, typeof(*pos), member); \ | ||
449 | &pos->member != (head); \ | ||
450 | pos = n, n = list_entry(n->member.prev, typeof(*n), member)) | ||
451 | |||
452 | /** | ||
439 | * list_for_each_rcu - iterate over an rcu-protected list | 453 | * list_for_each_rcu - iterate over an rcu-protected list |
440 | * @pos: the &struct list_head to use as a loop counter. | 454 | * @pos: the &struct list_head to use as a loop counter. |
441 | * @head: the head for your list. | 455 | * @head: the head for your list. |