1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-21 13:34:40 +03:00

list_next

This commit is contained in:
Alasdair Kergon 2003-05-06 12:01:13 +00:00
parent 9019ed2e77
commit 9a5e05a406
2 changed files with 10 additions and 0 deletions

View File

@ -56,6 +56,11 @@ static inline int list_end(struct list *head, struct list *elem)
return elem->n == head;
}
static inline struct list *list_next(struct list *head, struct list *elem)
{
return (list_end(head, elem) ? NULL : elem->n);
}
#define list_iterate(v, head) \
for (v = (head)->n; v != head; v = v->n)

View File

@ -56,6 +56,11 @@ static inline int list_end(struct list *head, struct list *elem)
return elem->n == head;
}
static inline struct list *list_next(struct list *head, struct list *elem)
{
return (list_end(head, elem) ? NULL : elem->n);
}
#define list_iterate(v, head) \
for (v = (head)->n; v != head; v = v->n)