diff options
author | Alasdair Kergon <agk@redhat.com> | 2001-11-28 13:45:50 +0000 |
---|---|---|
committer | Alasdair Kergon <agk@redhat.com> | 2001-11-28 13:45:50 +0000 |
commit | 579944d327a3adb932469093c4758e7faa8ac312 (patch) | |
tree | 4f08486a8028517c905dfae33275473aa6f38dda /libdm/datastruct | |
parent | 170f08cee0479561038ccf6e6a8d5d83cc78ee96 (diff) | |
download | lvm2-579944d327a3adb932469093c4758e7faa8ac312.tar.gz lvm2-579944d327a3adb932469093c4758e7faa8ac312.tar.xz lvm2-579944d327a3adb932469093c4758e7faa8ac312.zip |
o Tool support for segments.
o vgmerge working.
Diffstat (limited to 'libdm/datastruct')
-rw-r--r-- | libdm/datastruct/list.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/libdm/datastruct/list.h b/libdm/datastruct/list.h index 1c4a791c..cfda137a 100644 --- a/libdm/datastruct/list.h +++ b/libdm/datastruct/list.h @@ -49,6 +49,16 @@ static inline int list_empty(struct list *head) { #define list_iterate(v, head) \ for (v = (head)->n; v != head; v = v->n) +static inline int list_size(struct list *head) { + int s = 0; + struct list *v; + + list_iterate(v, head) + s++; + + return s; +} + #define list_item(v, t) \ ((t *)((uintptr_t)(v) - (uintptr_t)&((t *) 0)->list)) |