diff options
Diffstat (limited to 'lib/device/dev-cache.c')
-rw-r--r-- | lib/device/dev-cache.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/device/dev-cache.c b/lib/device/dev-cache.c index 85f9b499a..a8b132d41 100644 --- a/lib/device/dev-cache.c +++ b/lib/device/dev-cache.c @@ -52,6 +52,7 @@ static struct { struct dm_regex *preferred_names_matcher; const char *dev_dir; + int preferred_names_disabled; int has_scanned; long st_dev; struct dm_list dirs; @@ -166,11 +167,19 @@ void dev_set_preferred_name(struct dm_str_list *sl, struct device *dev) if (_cache.preferred_names_matcher) return; + if (_cache.preferred_names_disabled) + return; + log_debug_devs("%s: New preferred name", sl->str); dm_list_del(&sl->list); dm_list_add_h(&dev->aliases, &sl->list); } +void dev_cache_disable_preferred_names(void) +{ + _cache.preferred_names_disabled = 1; +} + /* * Check whether path0 or path1 contains the subpath. The path that * *does not* contain the subpath wins (return 0 or 1). If both paths |