diff options
author | Alasdair Kergon <agk@redhat.com> | 2010-11-09 12:34:40 +0000 |
---|---|---|
committer | Alasdair Kergon <agk@redhat.com> | 2010-11-09 12:34:40 +0000 |
commit | eb82bd052598cb6f5c3b94ccbf9b3e1434dd9419 (patch) | |
tree | 12bb9ff0555b92444b0fa3e1ff3f04e2513c90a3 /lib/datastruct/str_list.c | |
parent | 5a976864ee16b30535141a284fc845ee3403eae3 (diff) | |
download | lvm2-eb82bd052598cb6f5c3b94ccbf9b3e1434dd9419.tar.gz lvm2-eb82bd052598cb6f5c3b94ccbf9b3e1434dd9419.tar.xz lvm2-eb82bd052598cb6f5c3b94ccbf9b3e1434dd9419.zip |
Extend cling allocation policy to recognise PV tags (cling_by_tags).
Add allocation/cling_tag_list to lvm.conf.
Diffstat (limited to 'lib/datastruct/str_list.c')
-rw-r--r-- | lib/datastruct/str_list.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/lib/datastruct/str_list.c b/lib/datastruct/str_list.c index a6f061eb..b7101489 100644 --- a/lib/datastruct/str_list.c +++ b/lib/datastruct/str_list.c @@ -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; } |