aboutsummaryrefslogtreecommitdiffstats
path: root/xen/include/xen/list.h
diff options
context:
space:
mode:
Diffstat (limited to 'xen/include/xen/list.h')
-rw-r--r--xen/include/xen/list.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/xen/include/xen/list.h b/xen/include/xen/list.h
index 66cdfc814b..5072d0b924 100644
--- a/xen/include/xen/list.h
+++ b/xen/include/xen/list.h
@@ -162,6 +162,16 @@ static __inline__ void list_splice(struct list_head *list, struct list_head *hea
pos = n, n = pos->next)
/**
+ * list_for_each_backwards_safe - iterate backwards over a list safe against removal of list entry
+ * @pos: the &struct list_head to use as a loop counter.
+ * @n: another &struct list_head to use as temporary storage
+ * @head: the head for your list.
+ */
+#define list_for_each_backwards_safe(pos, n, head) \
+ for (pos = (head)->prev, n = 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 counter.
* @head: the head for your list.