1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-21 13:34:40 +03:00

o pfilter stores results for all aliases.

This commit is contained in:
Joe Thornber 2001-10-25 14:51:51 +00:00
parent c3ceee769f
commit c9a97a795a

View File

@ -165,12 +165,17 @@ static int _lookup_p(struct dev_filter *f, struct device *dev)
{ {
struct pfilter *pf = (struct pfilter *) f->private; struct pfilter *pf = (struct pfilter *) f->private;
void *l = hash_lookup(pf->devices, dev_name(dev)); void *l = hash_lookup(pf->devices, dev_name(dev));
struct list_head *tmp;
struct str_list *sl;
if (!l) { if (!l) {
l = pf->real->passes_filter(pf->real, dev) ? l = pf->real->passes_filter(pf->real, dev) ?
PF_GOOD_DEVICE : PF_BAD_DEVICE; PF_GOOD_DEVICE : PF_BAD_DEVICE;
hash_insert(pf->devices, dev_name(dev), l); list_for_each(tmp, &dev->aliases) {
sl = list_entry(tmp, struct str_list, list);
hash_insert(pf->devices, sl->str, l);
}
} }
return l == PF_GOOD_DEVICE; return l == PF_GOOD_DEVICE;