X-Git-Url: http://git.rot13.org/?a=blobdiff_plain;f=include%2Flinux%2Flist.h;h=75ce2cb4ff6ebc92a8fcaa557a9bd7b6b9b9b1b6;hb=bb04af0e2e5bcd8d1a5d7f7d5c704f7eb328f241;hp=ad9dcb9e337523337d5d2bacaa7c2e9f679f786a;hpb=e86908614f2c7fec401827e5cefd7a6ea9407f85;p=powerpc.git diff --git a/include/linux/list.h b/include/linux/list.h index ad9dcb9e33..75ce2cb4ff 100644 --- a/include/linux/list.h +++ b/include/linux/list.h @@ -477,6 +477,17 @@ static inline void list_splice_init_rcu(struct list_head *list, for (pos = (head)->next, n = pos->next; pos != (head); \ 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.