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

o It's a bit of a hack, but the regex filter now makes sure a device path

that passed the filter is at the front of the aliases list.
This commit is contained in:
Joe Thornber 2001-10-25 14:41:28 +00:00
parent 5e610278ad
commit c3ceee769f
2 changed files with 16 additions and 5 deletions

View File

@ -93,8 +93,10 @@ int persistent_filter_load(struct dev_filter *f)
goto out; goto out;
} }
_read_array(pf, cf, "persistent_filter_cache/valid_devices", PF_GOOD_DEVICE); _read_array(pf, cf, "persistent_filter_cache/valid_devices",
_read_array(pf, cf, "persistent_filter_cache/invalid_devices", PF_BAD_DEVICE); PF_GOOD_DEVICE);
_read_array(pf, cf, "persistent_filter_cache/invalid_devices",
PF_BAD_DEVICE);
if (hash_get_num_entries(pf->devices)) if (hash_get_num_entries(pf->devices))
r = 1; r = 1;

View File

@ -149,7 +149,7 @@ static int _build_matcher(struct rfilter *rf, struct config_value *val)
static int _accept_p(struct dev_filter *f, struct device *dev) static int _accept_p(struct dev_filter *f, struct device *dev)
{ {
int m, nothing_matched = 1; int m, nothing_matched = 1, first = 1;
struct rfilter *rf = (struct rfilter *) f->private; struct rfilter *rf = (struct rfilter *) f->private;
struct list_head *tmp; struct list_head *tmp;
struct str_list *sl; struct str_list *sl;
@ -161,9 +161,18 @@ static int _accept_p(struct dev_filter *f, struct device *dev)
if (m >= 0) { if (m >= 0) {
nothing_matched = 0; nothing_matched = 0;
if (bit(rf->accept, m)) if (bit(rf->accept, m)) {
if (!first) {
list_del(&sl->list);
list_add(&sl->list, &dev->aliases);
}
return 1; return 1;
}
} }
first = 0;
} }
/* /*