mirror of
git://sourceware.org/git/lvm2.git
synced 2025-03-25 18:50:51 +03:00
Add list_iterate that's safe with deletions.
This commit is contained in:
parent
5536aea0df
commit
5a933d4bee
@ -47,7 +47,10 @@ static inline int list_empty(struct list *head) {
|
||||
}
|
||||
|
||||
#define list_iterate(v, head) \
|
||||
for (v = (head)->n; v != head; v = v->n)
|
||||
for (v = (head)->n; v != head; v = v->n)
|
||||
|
||||
#define list_iterate_safe(v, t, head) \
|
||||
for (v = (head)->n, t = v->n; v != head; v = t, t = v->n)
|
||||
|
||||
static inline int list_size(struct list *head) {
|
||||
int s = 0;
|
||||
|
@ -47,7 +47,10 @@ static inline int list_empty(struct list *head) {
|
||||
}
|
||||
|
||||
#define list_iterate(v, head) \
|
||||
for (v = (head)->n; v != head; v = v->n)
|
||||
for (v = (head)->n; v != head; v = v->n)
|
||||
|
||||
#define list_iterate_safe(v, t, head) \
|
||||
for (v = (head)->n, t = v->n; v != head; v = t, t = v->n)
|
||||
|
||||
static inline int list_size(struct list *head) {
|
||||
int s = 0;
|
||||
|
Loading…
x
Reference in New Issue
Block a user