mirror of
git://sourceware.org/git/lvm2.git
synced 2025-03-10 16:58:47 +03:00
Refactor vgsplit - add 'lock_vg_from_first' flag.
Introduce 'lock_vg_from_first' flag to retain which vg was locked first. Should be no functional change. Author: Dave Wysochanski <dwysocha@redhat.com>
This commit is contained in:
parent
9cc31e6dff
commit
ab2d981a97
@ -218,6 +218,7 @@ int vgsplit(struct cmd_context *cmd, int argc, char **argv)
|
||||
int existing_vg = 0;
|
||||
int r = ECMD_FAILED;
|
||||
const char *lv_name;
|
||||
int lock_vg_from_first = 1;
|
||||
|
||||
if ((arg_count(cmd, name_ARG) + argc) < 3) {
|
||||
log_error("Existing VG, new VG and either physical volumes "
|
||||
@ -427,7 +428,12 @@ int vgsplit(struct cmd_context *cmd, int argc, char **argv)
|
||||
r = ECMD_PROCESSED;
|
||||
|
||||
bad:
|
||||
unlock_and_release_vg(cmd, vg_to, vg_name_to);
|
||||
unlock_and_release_vg(cmd, vg_from, vg_name_from);
|
||||
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