mirror of
git://sourceware.org/git/lvm2.git
synced 2024-12-21 13:34:40 +03:00
Use dm_list_iterate_items_safe
And avoid direct access to list member variables. Inline _free_li().
This commit is contained in:
parent
b6e97cea2c
commit
02aeb23f1f
@ -1,5 +1,6 @@
|
||||
Version 2.02.91 -
|
||||
===================================
|
||||
Use list functions for label_exit().
|
||||
Ensure strncpy() function always ends with '\0'.
|
||||
Set status in _fsadm_cmd() for error path.
|
||||
Add missing deps for lvm2api for rebuild when lvm-internal is changed.
|
||||
|
@ -56,11 +56,6 @@ static struct labeller_i *_alloc_li(const char *name, struct labeller *l)
|
||||
return li;
|
||||
}
|
||||
|
||||
static void _free_li(struct labeller_i *li)
|
||||
{
|
||||
dm_free(li);
|
||||
}
|
||||
|
||||
int label_init(void)
|
||||
{
|
||||
dm_list_init(&_labellers);
|
||||
@ -69,14 +64,12 @@ int label_init(void)
|
||||
|
||||
void label_exit(void)
|
||||
{
|
||||
struct dm_list *c, *n;
|
||||
struct labeller_i *li;
|
||||
struct labeller_i *li, *tli;
|
||||
|
||||
for (c = _labellers.n; c && c != &_labellers; c = n) {
|
||||
n = c->n;
|
||||
li = dm_list_item(c, struct labeller_i);
|
||||
dm_list_iterate_items_safe(li, tli, &_labellers) {
|
||||
dm_list_del(&li->list);
|
||||
li->l->ops->destroy(li->l);
|
||||
_free_li(li);
|
||||
dm_free(li);
|
||||
}
|
||||
|
||||
dm_list_init(&_labellers);
|
||||
|
Loading…
Reference in New Issue
Block a user