X-Git-Url: http://pilppa.org/gitweb/gitweb.cgi?a=blobdiff_plain;f=include%2Flinux%2Flist.h;h=75ce2cb4ff6ebc92a8fcaa557a9bd7b6b9b9b1b6;hb=b3a7ea8d50f6028964b468d13a095dfb2508b2fb;hp=ad9dcb9e337523337d5d2bacaa7c2e9f679f786a;hpb=4d5709a7b7d54fc5882d2943a14988a92d48c00a;p=linux-2.6-omap-h63xx.git diff --git a/include/linux/list.h b/include/linux/list.h index ad9dcb9e337..75ce2cb4ff6 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.