mirror of
git://sourceware.org/git/lvm2.git
synced 2025-01-26 14:04:15 +03:00
Refactor vgmerge - introduce lock_vg_from_first flag.
Should be no functional change. Author: Dave Wysochanski <dwysocha@redhat.com>
This commit is contained in:
parent
4494c25df7
commit
79430340e5
@ -21,6 +21,7 @@ static int _vgmerge_single(struct cmd_context *cmd, const char *vg_name_to,
|
||||
struct volume_group *vg_to, *vg_from;
|
||||
struct lv_list *lvl1, *lvl2;
|
||||
int r = ECMD_FAILED;
|
||||
int lock_vg_from_first = 0;
|
||||
|
||||
if (!strcmp(vg_name_to, vg_name_from)) {
|
||||
log_error("Duplicate volume group name \"%s\"", vg_name_from);
|
||||
@ -116,8 +117,13 @@ static int _vgmerge_single(struct cmd_context *cmd, const char *vg_name_to,
|
||||
vg_from->name, vg_to->name);
|
||||
r = ECMD_PROCESSED;
|
||||
bad:
|
||||
unlock_and_release_vg(cmd, vg_from, vg_name_from);
|
||||
unlock_and_release_vg(cmd, vg_to, vg_name_to);
|
||||
if (lock_vg_from_first) {
|
||||
unlock_and_release_vg(cmd, vg_to, vg_name_to);
|
||||
unlock_and_release_vg(cmd, vg_from, vg_name_from);
|
||||
} else {
|
||||
unlock_and_release_vg(cmd, vg_from, vg_name_from);
|
||||
unlock_and_release_vg(cmd, vg_to, vg_name_to);
|
||||
}
|
||||
return r;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user