summaryrefslogtreecommitdiff
path: root/include/linux/list.h
diff options
context:
space:
mode:
authorJulian Anastasov <ja@ssi.bg>2003-09-29 11:44:52 -0700
committerDavid S. Miller <davem@nuts.ninka.net>2003-09-29 11:44:52 -0700
commit5cf49e47c0c8a28b200dcf9ad2db9345f9ce1b72 (patch)
tree85c8375d561ae5f37520a4af1b0b13c5b5c11a18 /include/linux/list.h
parent57daa60466fac470193975bf8c89b796545332bb (diff)
[KERNEL]: Introduce list_for_each_entry_continue.
Diffstat (limited to 'include/linux/list.h')
-rw-r--r--include/linux/list.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/include/linux/list.h b/include/linux/list.h
index b0ce7a7c0e7a..9e218f0e471c 100644
--- a/include/linux/list.h
+++ b/include/linux/list.h
@@ -325,6 +325,19 @@ static inline void list_splice_init(struct list_head *list,
pos = list_entry(pos->member.prev, typeof(*pos), member), \
prefetch(pos->member.prev))
+/**
+ * list_for_each_entry_continue - iterate over list of given type
+ * continuing after existing point
+ * @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_continue(pos, head, member) \
+ for (pos = list_entry(pos->member.next, typeof(*pos), member), \
+ prefetch(pos->member.next); \
+ &pos->member != (head); \
+ pos = list_entry(pos->member.next, typeof(*pos), member), \
+ prefetch(pos->member.next))
/**
* list_for_each_entry_safe - iterate over list of given type safe against removal of list entry