int only_error_or_zero_target = 1;
int r = 0;
- if (dev_cache_use_dm_uuid_cache() &&
+ if (dev_cache_use_dm_devs_cache() &&
/* With cache we can avoid status calls for unusable UUIDs */
(dm_dev = dev_cache_get_dm_dev_by_devno(cmd, dev->dev)) &&
!_is_usable_uuid(dev, dm_dev->name, dm_dev->uuid, check.check_reserved, check.check_lv, is_lv))
const char *uuid;
int r = 0;
- if (dev_cache_use_dm_uuid_cache()) {
+ if (dev_cache_use_dm_devs_cache()) {
if ((dm_dev = dev_cache_get_dm_dev_by_devno(cmd, MKDEV(major, minor)))) {
dm_strncpy(uuid_buf, dm_dev->uuid, uuid_buf_size);
return 1;
dm_strncpy(old_style_dlid, dlid, sizeof(old_style_dlid));
- if (dev_cache_use_dm_uuid_cache() &&
+ if (dev_cache_use_dm_devs_cache() &&
!dev_cache_get_dm_dev_by_uuid(cmd, dlid) &&
!dev_cache_get_dm_dev_by_uuid(cmd, old_style_dlid)) {
log_debug("Cached as inactive %s.", name);
if (!(dlid = build_dm_uuid(dm->track_pending_delete ? dm->cmd->pending_delete_mem : dm->mem, lv, layer)))
return_0;
- if (dev_cache_use_dm_uuid_cache()) {
+ if (dev_cache_use_dm_devs_cache()) {
if (!(dm_dev = dev_cache_get_dm_dev_by_uuid(dm->cmd, dlid))) {
log_debug("Cached as not present %s.", name);
return 1;
}
}
- dev_cache_destroy_dm_uuids();
+ dev_cache_destroy_dm_devs();
log_debug("Running check command on %s", mpath);
/* Drop any cache before DM table manipulation within locked section
* TODO: check if it makes sense to manage cache within lock */
- dev_cache_destroy_dm_uuids();
+ dev_cache_destroy_dm_devs();
dtree = _create_partial_dtree(dm, lv, laopts->origin_only);
struct radix_tree *devices;
struct dm_regex *preferred_names_matcher;
const char *dev_dir;
- int use_dm_uuid_cache;
+ int use_dm_devs_cache;
size_t dev_dir_len;
int has_scanned;
return r;
}
-int dev_cache_use_dm_uuid_cache(void)
+int dev_cache_use_dm_devs_cache(void)
{
- return _cache.use_dm_uuid_cache;
+ return _cache.use_dm_devs_cache;
}
-void dev_cache_destroy_dm_uuids(void)
+void dev_cache_destroy_dm_devs(void)
{
- _cache.use_dm_uuid_cache = 0;
+ _cache.use_dm_devs_cache = 0;
if (_cache.dm_devnos) {
radix_tree_destroy(_cache.dm_devnos);
dm_device_list_destroy(&_cache.dm_devs);
}
-int dev_cache_update_dm_uuids(void)
+int dev_cache_update_dm_devs(void)
{
struct dm_active_device *dm_dev;
unsigned devs_features;
uint32_t d;
- dev_cache_destroy_dm_uuids();
+ dev_cache_destroy_dm_devs();
if (!get_dm_active_devices(NULL, &_cache.dm_devs, &devs_features))
return 1;
//radix_tree_dump(_cache.dm_devnos, stdout);
//radix_tree_dump(_cache.dm_uuids, stdout);
- _cache.use_dm_uuid_cache = 1;
+ _cache.use_dm_devs_cache = 1;
return 1;
}
vt.num_open);
}
- dev_cache_destroy_dm_uuids();
+ dev_cache_destroy_dm_devs();
if (_cache.mem)
dm_pool_destroy(_cache.mem);
struct dm_list *dev_cache_get_dev_list_for_vgid(const char *vgid);
struct dm_list *dev_cache_get_dev_list_for_lvid(const char *lvid);
-int dev_cache_use_dm_uuid_cache(void);
-int dev_cache_update_dm_uuids(void);
-void dev_cache_destroy_dm_uuids(void);
+int dev_cache_use_dm_devs_cache(void);
+int dev_cache_update_dm_devs(void);
+void dev_cache_destroy_dm_devs(void);
const struct dm_active_device *
dev_cache_get_dm_dev_by_devno(struct cmd_context *cmd, dev_t devno);
const struct dm_active_device *
* here, before processing the hints file, so that the dm uuid checks
* in hint processing can benefit from the dm uuid cache.)
*/
- if (!dev_cache_update_dm_uuids())
+ if (!dev_cache_update_dm_devs())
return_0;
/*
int sync_local_dev_names(struct cmd_context* cmd)
{
- dev_cache_destroy_dm_uuids();
+ dev_cache_destroy_dm_devs();
memlock_unlock(cmd);
fs_unlock();
return 1;