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

cleanup: reuse existing function

Call lv_update_and_reload implementation.
This commit is contained in:
Zdenek Kabelac 2016-12-11 14:31:47 +01:00
parent 6f84d3c69c
commit 6cd68c55dd

View File

@ -83,38 +83,8 @@ int pvmove_update_metadata(struct cmd_context *cmd, struct volume_group *vg,
struct dm_list *lvs_changed __attribute__((unused)),
unsigned flags __attribute__((unused)))
{
log_verbose("Updating volume group metadata.");
if (!vg_write(vg)) {
log_error("ABORTING: Volume group metadata update failed.");
return 0;
}
if (!suspend_lv(cmd, lv_mirr)) {
vg_revert(vg);
log_error("ABORTING: Temporary pvmove mirror reload failed.");
if (!revert_lv(cmd, lv_mirr))
stack;
return 0;
}
/* Commit on-disk metadata */
if (!vg_commit(vg)) {
log_error("ABORTING: Volume group metadata update failed.");
if (!resume_lv(cmd, lv_mirr))
log_error("Unable to reactivate logical volume \"%s\".",
lv_mirr->name);
if (!revert_lv(cmd, lv_mirr))
stack;
return 0;
}
if (!resume_lv(cmd, lv_mirr)) {
log_error("Unable to reactivate logical volume \"%s\".",
lv_mirr->name);
return 0;
}
backup(vg);
if (!lv_update_and_reload(lv_mirr))
return_0;
return 1;
}