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

dev_manager: remove disable_dm_dev flag

Lvm currenly drops cache before first table manipulation
there is no need for this flag ATM.
This commit is contained in:
Zdenek Kabelac 2024-05-24 21:21:16 +02:00
parent e211768d1c
commit b63e54d0ed
3 changed files with 2 additions and 10 deletions

View File

@ -2461,7 +2461,6 @@ int lv_deactivate(struct cmd_context *cmd, const char *lvid_s, const struct logi
const struct lv_activate_opts laopts = { .skip_in_use = 1 }; const struct lv_activate_opts laopts = { .skip_in_use = 1 };
struct dm_list *snh; struct dm_list *snh;
int r = 0; int r = 0;
unsigned tmp_state;
if (!activation()) if (!activation())
return 1; return 1;
@ -2534,9 +2533,6 @@ int lv_deactivate(struct cmd_context *cmd, const char *lvid_s, const struct logi
} }
critical_section_dec(cmd, "deactivated"); critical_section_dec(cmd, "deactivated");
tmp_state = cmd->disable_dm_devs;
cmd->disable_dm_devs = 1;
if (!lv_info(cmd, lv, 0, &info, 0, 0) || info.exists) { if (!lv_info(cmd, lv, 0, &info, 0, 0) || info.exists) {
/* Turn into log_error, but we do not log error */ /* Turn into log_error, but we do not log error */
log_debug_activation("Deactivated volume is still %s present.", log_debug_activation("Deactivated volume is still %s present.",
@ -2544,7 +2540,6 @@ int lv_deactivate(struct cmd_context *cmd, const char *lvid_s, const struct logi
r = 0; r = 0;
} }
cmd->disable_dm_devs = tmp_state;
out: out:
return r; return r;

View File

@ -1062,8 +1062,7 @@ int dev_manager_info(struct cmd_context *cmd,
if (!(dlid = build_dm_uuid(cmd->mem, lv, layer))) if (!(dlid = build_dm_uuid(cmd->mem, lv, layer)))
goto_out; goto_out;
if (!cmd->disable_dm_devs && if (cmd->cache_dm_devs &&
cmd->cache_dm_devs &&
!dm_device_list_find_by_uuid(cmd->cache_dm_devs, dlid, NULL)) { !dm_device_list_find_by_uuid(cmd->cache_dm_devs, dlid, NULL)) {
log_debug("Cached as inactive %s.", name); log_debug("Cached as inactive %s.", name);
if (dminfo) if (dminfo)
@ -2436,8 +2435,7 @@ static int _add_dev_to_dtree(struct dev_manager *dm, struct dm_tree *dtree,
if (!(dlid = build_dm_uuid(dm->track_pending_delete ? dm->cmd->pending_delete_mem : dm->mem, lv, layer))) if (!(dlid = build_dm_uuid(dm->track_pending_delete ? dm->cmd->pending_delete_mem : dm->mem, lv, layer)))
return_0; return_0;
if (!dm->cmd->disable_dm_devs && if (dm->cmd->cache_dm_devs) {
dm->cmd->cache_dm_devs) {
if (!dm_device_list_find_by_uuid(dm->cmd->cache_dm_devs, dlid, &dev)) { if (!dm_device_list_find_by_uuid(dm->cmd->cache_dm_devs, dlid, &dev)) {
log_debug("Cached as not present %s.", name); log_debug("Cached as not present %s.", name);
return 1; return 1;

View File

@ -211,7 +211,6 @@ struct cmd_context {
unsigned event_activation:1; /* whether event_activation is set */ unsigned event_activation:1; /* whether event_activation is set */
unsigned udevoutput:1; unsigned udevoutput:1;
unsigned online_vg_file_removed:1; unsigned online_vg_file_removed:1;
unsigned disable_dm_devs:1; /* temporarily disable use of dm devs cache */
unsigned filter_regex_set_preferred_name_disable:1; /* prevent dev_set_preferred_name */ unsigned filter_regex_set_preferred_name_disable:1; /* prevent dev_set_preferred_name */
unsigned device_ids_check_product_uuid:1; unsigned device_ids_check_product_uuid:1;
unsigned device_ids_check_hostname:1; unsigned device_ids_check_hostname:1;