mirror of
git://sourceware.org/git/lvm2.git
synced 2024-12-21 13:34:40 +03:00
datastruct: Add str_list_wipe.
This commit is contained in:
parent
16019b518e
commit
e3efcdc9f5
@ -1,5 +1,6 @@
|
||||
Version 2.02.152 -
|
||||
==================================
|
||||
Add str_list_wipe.
|
||||
Improve support for interrupting procesing of volumes during lvchange.
|
||||
Use failed command return code when lvchanging read-only volume.
|
||||
Show creation transaction_id and zeroing state of pool with thin volume.
|
||||
|
@ -92,7 +92,15 @@ void str_list_del(struct dm_list *sll, const char *str)
|
||||
|
||||
dm_list_iterate_safe(slh, slht, sll)
|
||||
if (!strcmp(str, dm_list_item(slh, struct dm_str_list)->str))
|
||||
dm_list_del(slh);
|
||||
dm_list_del(slh);
|
||||
}
|
||||
|
||||
void str_list_wipe(struct dm_list *sll)
|
||||
{
|
||||
struct dm_list *slh, *slht;
|
||||
|
||||
dm_list_iterate_safe(slh, slht, sll)
|
||||
dm_list_del(slh);
|
||||
}
|
||||
|
||||
int str_list_dup(struct dm_pool *mem, struct dm_list *sllnew,
|
||||
@ -118,8 +126,8 @@ int str_list_match_item(const struct dm_list *sll, const char *str)
|
||||
struct dm_str_list *sl;
|
||||
|
||||
dm_list_iterate_items(sl, sll)
|
||||
if (!strcmp(str, sl->str))
|
||||
return 1;
|
||||
if (!strcmp(str, sl->str))
|
||||
return 1;
|
||||
|
||||
return 0;
|
||||
}
|
||||
@ -153,8 +161,8 @@ int str_list_lists_equal(const struct dm_list *sll, const struct dm_list *sll2)
|
||||
return 0;
|
||||
|
||||
dm_list_iterate_items(sl, sll)
|
||||
if (!str_list_match_item(sll2, sl->str))
|
||||
return 0;
|
||||
if (!str_list_match_item(sll2, sl->str))
|
||||
return 0;
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
@ -25,6 +25,7 @@ int str_list_add_list(struct dm_pool *mem, struct dm_list *sll, struct dm_list *
|
||||
int str_list_add_no_dup_check(struct dm_pool *mem, struct dm_list *sll, const char *str);
|
||||
int str_list_add_h_no_dup_check(struct dm_pool *mem, struct dm_list *sll, const char *str);
|
||||
void str_list_del(struct dm_list *sll, const char *str);
|
||||
void str_list_wipe(struct dm_list *sll);
|
||||
int str_list_match_item(const struct dm_list *sll, const char *str);
|
||||
int str_list_match_list(const struct dm_list *sll, const struct dm_list *sll2, const char **tag_matched);
|
||||
int str_list_lists_equal(const struct dm_list *sll, const struct dm_list *sll2);
|
||||
|
Loading…
Reference in New Issue
Block a user