summaryrefslogtreecommitdiff
path: root/include/linux/list.h
diff options
context:
space:
mode:
authorPatrick Mochel <mochel@osdl.org>2003-06-10 01:25:48 -0700
committerPatrick Mochel <mochel@osdl.org>2003-06-10 01:25:48 -0700
commitbe9e929da5c6deff7004e455010965ef71998324 (patch)
treefffaa7c1ddab0af300d720828e3b4eab5c53f4b2 /include/linux/list.h
parentae6a0c465d560a2c5e1fa16dd3d2ed769119cf2c (diff)
parent3d983e57eeb0d84ffafe1bb5b78688646ebd1d17 (diff)
Hand merge
Diffstat (limited to 'include/linux/list.h')
-rw-r--r--include/linux/list.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/include/linux/list.h b/include/linux/list.h
index abf35a4e5b37..be4be88015d7 100644
--- a/include/linux/list.h
+++ b/include/linux/list.h
@@ -297,6 +297,20 @@ static inline void list_splice_init(struct list_head *list,
prefetch(pos->member.next))
/**
+ * list_for_each_entry_reverse - iterate backwards over list of given type.
+ * @pos: the type * to use as a loop counter.
+ * @head: the head for your list.
+ * @member: the name of the list_struct within the struct.
+ */
+#define list_for_each_entry_reverse(pos, head, member) \
+ for (pos = list_entry((head)->prev, typeof(*pos), member), \
+ prefetch(pos->member.prev); \
+ &pos->member != (head); \
+ pos = list_entry(pos->member.prev, typeof(*pos), member), \
+ prefetch(pos->member.prev))
+
+
+/**
* list_for_each_entry_safe - iterate over list of given type safe against removal of list entry
* @pos: the type * to use as a loop counter.
* @n: another type * to use as temporary storage