mirror of
git://sourceware.org/git/lvm2.git
synced 2025-01-03 05:18:29 +03:00
cleanup: reuse existing function
Call lv_update_and_reload implementation.
This commit is contained in:
parent
6f84d3c69c
commit
6cd68c55dd
@ -83,38 +83,8 @@ int pvmove_update_metadata(struct cmd_context *cmd, struct volume_group *vg,
|
|||||||
struct dm_list *lvs_changed __attribute__((unused)),
|
struct dm_list *lvs_changed __attribute__((unused)),
|
||||||
unsigned flags __attribute__((unused)))
|
unsigned flags __attribute__((unused)))
|
||||||
{
|
{
|
||||||
log_verbose("Updating volume group metadata.");
|
if (!lv_update_and_reload(lv_mirr))
|
||||||
if (!vg_write(vg)) {
|
return_0;
|
||||||
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);
|
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user