1
0
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:
Alasdair G Kergon 2016-04-29 19:47:15 +01:00
parent 16019b518e
commit e3efcdc9f5
3 changed files with 15 additions and 5 deletions

View File

@ -1,5 +1,6 @@
Version 2.02.152 - Version 2.02.152 -
================================== ==================================
Add str_list_wipe.
Improve support for interrupting procesing of volumes during lvchange. Improve support for interrupting procesing of volumes during lvchange.
Use failed command return code when lvchanging read-only volume. Use failed command return code when lvchanging read-only volume.
Show creation transaction_id and zeroing state of pool with thin volume. Show creation transaction_id and zeroing state of pool with thin volume.

View File

@ -92,7 +92,15 @@ void str_list_del(struct dm_list *sll, const char *str)
dm_list_iterate_safe(slh, slht, sll) dm_list_iterate_safe(slh, slht, sll)
if (!strcmp(str, dm_list_item(slh, struct dm_str_list)->str)) 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, 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; struct dm_str_list *sl;
dm_list_iterate_items(sl, sll) dm_list_iterate_items(sl, sll)
if (!strcmp(str, sl->str)) if (!strcmp(str, sl->str))
return 1; return 1;
return 0; return 0;
} }
@ -153,8 +161,8 @@ int str_list_lists_equal(const struct dm_list *sll, const struct dm_list *sll2)
return 0; return 0;
dm_list_iterate_items(sl, sll) dm_list_iterate_items(sl, sll)
if (!str_list_match_item(sll2, sl->str)) if (!str_list_match_item(sll2, sl->str))
return 0; return 0;
return 1; return 1;
} }

View File

@ -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_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); 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_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_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_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); int str_list_lists_equal(const struct dm_list *sll, const struct dm_list *sll2);