diff options
| author | Arnaldo Carvalho de Melo <acme@mandriva.com> | 2006-03-20 20:19:17 -0500 |
|---|---|---|
| committer | David S. Miller <davem@davemloft.net> | 2006-03-20 20:19:17 -0500 |
| commit | e229c2fb3370a0c4ebac06cad67ce1cb35abcfe6 (patch) | |
| tree | fc7ceeeeea4397e06c6ee5cfb597ba0d441beeea /include/linux | |
| parent | 7b204afd45820fc21b5983205ad535c6b8088765 (diff) | |
[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')
| -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 beb6e48e116f..67258b47e9ca 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, | |||
| 411 | pos = list_entry(pos->member.next, typeof(*pos), member)) | 411 | pos = list_entry(pos->member.next, typeof(*pos), member)) |
| 412 | 412 | ||
| 413 | /** | 413 | /** |
| 414 | * list_for_each_entry_from - iterate over list of given type | ||
| 415 | * continuing from existing point | ||
| 416 | * @pos: the type * to use as a loop counter. | ||
| 417 | * @head: the head for your list. | ||
| 418 | * @member: the name of the list_struct within the struct. | ||
| 419 | */ | ||
| 420 | #define list_for_each_entry_from(pos, head, member) \ | ||
| 421 | for (; prefetch(pos->member.next), &pos->member != (head); \ | ||
| 422 | pos = list_entry(pos->member.next, typeof(*pos), member)) | ||
| 423 | |||
| 424 | /** | ||
| 414 | * list_for_each_entry_safe - iterate over list of given type safe against removal of list entry | 425 | * list_for_each_entry_safe - iterate over list of given type safe against removal of list entry |
| 415 | * @pos: the type * to use as a loop counter. | 426 | * @pos: the type * to use as a loop counter. |
| 416 | * @n: another type * to use as temporary storage | 427 | * @n: another type * to use as temporary storage |
