mirror of
git://sourceware.org/git/lvm2.git
synced 2024-12-21 13:34:40 +03:00
skip some clvmd-specific code in common cases
This, or something like it, can probably be done in many other places.
This commit is contained in:
parent
47bfac21ca
commit
4670e9f698
@ -913,6 +913,7 @@ int init_clvm(struct dm_hash_table *excl_uuid)
|
||||
return 0;
|
||||
}
|
||||
|
||||
cmd->is_clvmd = 1;
|
||||
cmd->cmd_line = "clvmd";
|
||||
|
||||
/* Check lvm.conf is setup for cluster-LVM */
|
||||
|
@ -2154,6 +2154,9 @@ static int _lv_suspend(struct cmd_context *cmd, const char *lvid_s,
|
||||
if (!activation())
|
||||
return 1;
|
||||
|
||||
if (!cmd->is_clvmd)
|
||||
goto skip_read;
|
||||
|
||||
if (lv && lv_pre)
|
||||
goto skip_read;
|
||||
|
||||
@ -2223,8 +2226,10 @@ skip_read:
|
||||
* did happen (or failed), and it will resume LVs using the
|
||||
* new/precommitted metadata if the vg_commit succeeded.
|
||||
*/
|
||||
lvmcache_save_vg(lv->vg, 0);
|
||||
lvmcache_save_vg(lv_pre->vg, 1);
|
||||
if (cmd->is_clvmd) {
|
||||
lvmcache_save_vg(lv->vg, 0);
|
||||
lvmcache_save_vg(lv_pre->vg, 1);
|
||||
}
|
||||
|
||||
if (!info.exists || info.suspended) {
|
||||
if (!error_if_not_suspended) {
|
||||
|
2
lib/cache/lvmcache.c
vendored
2
lib/cache/lvmcache.c
vendored
@ -246,8 +246,6 @@ static void _drop_metadata(const char *vgname, int drop_precommitted)
|
||||
if (!(vginfo = lvmcache_vginfo_from_vgname(vgname, NULL)))
|
||||
return;
|
||||
|
||||
log_debug_cache("lvmcache: dropping saved_vg %s pre %d", vgname, drop_precommitted);
|
||||
|
||||
if (drop_precommitted)
|
||||
_saved_vg_free(vginfo, 0, 1);
|
||||
else
|
||||
|
@ -170,6 +170,7 @@ struct cmd_context {
|
||||
unsigned mirror_warn_printed:1; /* command already printed warning about non-monitored mirrors */
|
||||
unsigned pvscan_cache_single:1;
|
||||
unsigned can_use_one_scan:1;
|
||||
unsigned is_clvmd:1;
|
||||
|
||||
/*
|
||||
* Filtering.
|
||||
|
Loading…
Reference in New Issue
Block a user