mirror of
git://sourceware.org/git/lvm2.git
synced 2025-01-17 06:04:23 +03:00
Actually pass LV metadata to activation code, when available.
This ties the two preceding changes together, actually using the "ondisk" version of VG metadata instead of calling into lvmcache when activating volumes. The cache hooks are still used as a fallback, because we don't have an uncached scanning API yet.
This commit is contained in:
parent
f65dd341a5
commit
df4c0bedfb
@ -295,17 +295,17 @@ static int _file_lock_resource(struct cmd_context *cmd, const char *resource,
|
||||
switch (flags & LCK_TYPE_MASK) {
|
||||
case LCK_UNLOCK:
|
||||
log_very_verbose("Unlocking LV %s%s%s", resource, origin_only ? " without snapshots" : "", revert ? " (reverting)" : "");
|
||||
if (!lv_resume_if_active(cmd, resource, origin_only, 0, revert, NULL))
|
||||
if (!lv_resume_if_active(cmd, resource, origin_only, 0, revert, lv_ondisk(lv)))
|
||||
return 0;
|
||||
break;
|
||||
case LCK_NULL:
|
||||
log_very_verbose("Locking LV %s (NL)", resource);
|
||||
if (!lv_deactivate(cmd, resource, NULL))
|
||||
if (!lv_deactivate(cmd, resource, lv_ondisk(lv)))
|
||||
return 0;
|
||||
break;
|
||||
case LCK_READ:
|
||||
log_very_verbose("Locking LV %s (R)", resource);
|
||||
if (!lv_activate_with_filter(cmd, resource, 0, NULL))
|
||||
if (!lv_activate_with_filter(cmd, resource, 0, lv_ondisk(lv)))
|
||||
return 0;
|
||||
break;
|
||||
case LCK_PREAD:
|
||||
@ -313,12 +313,12 @@ static int _file_lock_resource(struct cmd_context *cmd, const char *resource,
|
||||
break;
|
||||
case LCK_WRITE:
|
||||
log_very_verbose("Locking LV %s (W)%s", resource, origin_only ? " without snapshots" : "");
|
||||
if (!lv_suspend_if_active(cmd, resource, origin_only, 0, NULL))
|
||||
if (!lv_suspend_if_active(cmd, resource, origin_only, 0, lv_ondisk(lv)))
|
||||
return 0;
|
||||
break;
|
||||
case LCK_EXCL:
|
||||
log_very_verbose("Locking LV %s (EX)", resource);
|
||||
if (!lv_activate_with_filter(cmd, resource, 1, NULL))
|
||||
if (!lv_activate_with_filter(cmd, resource, 1, lv_ondisk(lv)))
|
||||
return 0;
|
||||
break;
|
||||
default:
|
||||
|
@ -44,15 +44,15 @@ static int _no_lock_resource(struct cmd_context *cmd, const char *resource,
|
||||
case LCK_LV:
|
||||
switch (flags & LCK_TYPE_MASK) {
|
||||
case LCK_NULL:
|
||||
return lv_deactivate(cmd, resource, lv);
|
||||
return lv_deactivate(cmd, resource, lv_ondisk(lv));
|
||||
case LCK_UNLOCK:
|
||||
return lv_resume_if_active(cmd, resource, (flags & LCK_ORIGIN_ONLY) ? 1: 0, 0, (flags & LCK_REVERT) ? 1 : 0, NULL);
|
||||
case LCK_READ:
|
||||
return lv_activate_with_filter(cmd, resource, 0, NULL);
|
||||
return lv_activate_with_filter(cmd, resource, 0, lv_ondisk(lv));
|
||||
case LCK_WRITE:
|
||||
return lv_suspend_if_active(cmd, resource, (flags & LCK_ORIGIN_ONLY) ? 1 : 0, 0, lv);
|
||||
case LCK_EXCL:
|
||||
return lv_activate_with_filter(cmd, resource, 1, NULL);
|
||||
return lv_activate_with_filter(cmd, resource, 1, lv_ondisk(lv));
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user