diff options
Diffstat (limited to 'include/linux/list.h')
-rw-r--r-- | include/linux/list.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/include/linux/list.h b/include/linux/list.h index ad9dcb9e337..b0cf0135fe3 100644 --- a/include/linux/list.h +++ b/include/linux/list.h @@ -478,6 +478,18 @@ static inline void list_splice_init_rcu(struct list_head *list, pos = n, n = pos->next) /** + * list_for_each_prev_safe - iterate over a list backwards safe against removal + of list entry + * @pos: the &struct list_head to use as a loop cursor. + * @n: another &struct list_head to use as temporary storage + * @head: the head for your list. + */ +#define list_for_each_prev_safe(pos, n, head) \ + for (pos = (head)->prev, n = pos->prev; \ + prefetch(pos->prev), pos != (head); \ + pos = n, n = pos->prev) + +/** * list_for_each_entry - iterate over list of given type * @pos: the type * to use as a loop cursor. * @head: the head for your list. |