diff options
author | Arnaldo Carvalho de Melo <acme@mandriva.com> | 2006-03-20 17:19:17 -0800 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2006-03-20 17:19:17 -0800 |
commit | e229c2fb3370a0c4ebac06cad67ce1cb35abcfe6 (patch) | |
tree | fc7ceeeeea4397e06c6ee5cfb597ba0d441beeea /include/linux/list.h | |
parent | 7b204afd45820fc21b5983205ad535c6b8088765 (diff) | |
download | kernel_samsung_espresso10-e229c2fb3370a0c4ebac06cad67ce1cb35abcfe6.zip kernel_samsung_espresso10-e229c2fb3370a0c4ebac06cad67ce1cb35abcfe6.tar.gz kernel_samsung_espresso10-e229c2fb3370a0c4ebac06cad67ce1cb35abcfe6.tar.bz2 |
[LIST]: Introduce list_for_each_entry_from
For iterating over list of given type continuing from existing point.
Signed-off-by: Arnaldo Carvalho de Melo <acme@mandriva.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/linux/list.h')
-rw-r--r-- | include/linux/list.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/include/linux/list.h b/include/linux/list.h index beb6e48..67258b4 100644 --- a/include/linux/list.h +++ b/include/linux/list.h @@ -411,6 +411,17 @@ static inline void list_splice_init(struct list_head *list, pos = list_entry(pos->member.next, typeof(*pos), member)) /** + * list_for_each_entry_from - iterate over list of given type + * continuing from 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_from(pos, head, member) \ + for (; prefetch(pos->member.next), &pos->member != (head); \ + pos = list_entry(pos->member.next, typeof(*pos), member)) + +/** * 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 |