1
0
mirror of git://sourceware.org/git/lvm2.git synced 2025-01-03 05:18:29 +03:00

Use dm_list_iterate_items_safe

And avoid direct access to list member variables.
Inline _free_li().
This commit is contained in:
Zdenek Kabelac 2012-02-08 11:12:18 +00:00
parent b6e97cea2c
commit 02aeb23f1f
2 changed files with 5 additions and 11 deletions

View File

@ -1,5 +1,6 @@
Version 2.02.91 - Version 2.02.91 -
=================================== ===================================
Use list functions for label_exit().
Ensure strncpy() function always ends with '\0'. Ensure strncpy() function always ends with '\0'.
Set status in _fsadm_cmd() for error path. Set status in _fsadm_cmd() for error path.
Add missing deps for lvm2api for rebuild when lvm-internal is changed. Add missing deps for lvm2api for rebuild when lvm-internal is changed.

View File

@ -56,11 +56,6 @@ static struct labeller_i *_alloc_li(const char *name, struct labeller *l)
return li; return li;
} }
static void _free_li(struct labeller_i *li)
{
dm_free(li);
}
int label_init(void) int label_init(void)
{ {
dm_list_init(&_labellers); dm_list_init(&_labellers);
@ -69,14 +64,12 @@ int label_init(void)
void label_exit(void) void label_exit(void)
{ {
struct dm_list *c, *n; struct labeller_i *li, *tli;
struct labeller_i *li;
for (c = _labellers.n; c && c != &_labellers; c = n) { dm_list_iterate_items_safe(li, tli, &_labellers) {
n = c->n; dm_list_del(&li->list);
li = dm_list_item(c, struct labeller_i);
li->l->ops->destroy(li->l); li->l->ops->destroy(li->l);
_free_li(li); dm_free(li);
} }
dm_list_init(&_labellers); dm_list_init(&_labellers);