1
0
mirror of git://sourceware.org/git/lvm2.git synced 2025-07-30 23:41:55 +03:00

Extend cling allocation policy to recognise PV tags (cling_by_tags).

Add allocation/cling_tag_list to lvm.conf.
This commit is contained in:
Alasdair Kergon
2010-11-09 12:34:40 +00:00
parent 5a976864ee
commit eb82bd0525
12 changed files with 176 additions and 28 deletions

View File

@ -93,14 +93,18 @@ int str_list_match_item(const struct dm_list *sll, const char *str)
/*
* Is at least one item on both lists?
* If tag_matched is non-NULL, it is set to the tag that matched.
*/
int str_list_match_list(const struct dm_list *sll, const struct dm_list *sll2)
int str_list_match_list(const struct dm_list *sll, const struct dm_list *sll2, char **tag_matched)
{
struct str_list *sl;
dm_list_iterate_items(sl, sll)
if (str_list_match_item(sll2, sl->str))
return 1;
if (str_list_match_item(sll2, sl->str)) {
if (tag_matched)
*tag_matched = sl->str;
return 1;
}
return 0;
}