mirror of
https://github.com/adulau/aha.git
synced 2024-12-29 12:16:20 +00:00
[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>
This commit is contained in:
parent
7b204afd45
commit
e229c2fb33
1 changed files with 11 additions and 0 deletions
|
@ -410,6 +410,17 @@ static inline void list_splice_init(struct list_head *list,
|
|||
prefetch(pos->member.next), &pos->member != (head); \
|
||||
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.
|
||||
|
|
Loading…
Reference in a new issue