mirror of
git://sourceware.org/git/lvm2.git
synced 2025-02-25 21:57:45 +03:00
Remove READ_REQUIRE_RESIZEABLE flag from vgsplit.
Remove READ_REQUIRE_RESIZEABLE flag from vgsplit similar to the removal from vgextend. Move the check inside the functions that actually move pvs from one vg structure to another. Should be no functional change. Signed-off-by: Dave Wysochanski <dwysocha@redhat.com> Acked-by: Alasdair G Kergon <agk@redhat.com>
This commit is contained in:
parent
6452d4ae9d
commit
ffc12b3fc1
@ -70,6 +70,8 @@ static struct physical_volume *_find_pv_in_vg_by_uuid(const struct volume_group
|
|||||||
static vg_t *_vg_make_handle(struct cmd_context *cmd,
|
static vg_t *_vg_make_handle(struct cmd_context *cmd,
|
||||||
struct volume_group *vg,
|
struct volume_group *vg,
|
||||||
uint32_t failure);
|
uint32_t failure);
|
||||||
|
static uint32_t _vg_bad_status_bits(const struct volume_group *vg,
|
||||||
|
uint32_t status);
|
||||||
|
|
||||||
unsigned long set_pe_align(struct physical_volume *pv, unsigned long data_alignment)
|
unsigned long set_pe_align(struct physical_volume *pv, unsigned long data_alignment)
|
||||||
{
|
{
|
||||||
@ -287,6 +289,10 @@ int move_pv(struct volume_group *vg_from, struct volume_group *vg_to,
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (_vg_bad_status_bits(vg_from, RESIZEABLE_VG) ||
|
||||||
|
_vg_bad_status_bits(vg_to, RESIZEABLE_VG))
|
||||||
|
return 0;
|
||||||
|
|
||||||
dm_list_move(&vg_to->pvs, &pvl->list);
|
dm_list_move(&vg_to->pvs, &pvl->list);
|
||||||
|
|
||||||
vg_from->pv_count--;
|
vg_from->pv_count--;
|
||||||
@ -319,6 +325,10 @@ int move_pvs_used_by_lv(struct volume_group *vg_from,
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (_vg_bad_status_bits(vg_from, RESIZEABLE_VG) ||
|
||||||
|
_vg_bad_status_bits(vg_to, RESIZEABLE_VG))
|
||||||
|
return 0;
|
||||||
|
|
||||||
dm_list_iterate_items(lvseg, &lvl->lv->segments) {
|
dm_list_iterate_items(lvseg, &lvl->lv->segments) {
|
||||||
if (lvseg->log_lv)
|
if (lvseg->log_lv)
|
||||||
if (!move_pvs_used_by_lv(vg_from, vg_to,
|
if (!move_pvs_used_by_lv(vg_from, vg_to,
|
||||||
|
@ -248,8 +248,7 @@ int vgsplit(struct cmd_context *cmd, int argc, char **argv)
|
|||||||
|
|
||||||
log_verbose("Checking for volume group \"%s\"", vg_name_from);
|
log_verbose("Checking for volume group \"%s\"", vg_name_from);
|
||||||
|
|
||||||
vg_from = vg_read_for_update(cmd, vg_name_from, NULL,
|
vg_from = vg_read_for_update(cmd, vg_name_from, NULL, 0);
|
||||||
READ_REQUIRE_RESIZEABLE);
|
|
||||||
if (vg_read_error(vg_from)) {
|
if (vg_read_error(vg_from)) {
|
||||||
vg_release(vg_from);
|
vg_release(vg_from);
|
||||||
return ECMD_FAILED;
|
return ECMD_FAILED;
|
||||||
@ -283,8 +282,7 @@ int vgsplit(struct cmd_context *cmd, int argc, char **argv)
|
|||||||
if (vg_read_error(vg_to) == FAILED_EXIST) {
|
if (vg_read_error(vg_to) == FAILED_EXIST) {
|
||||||
existing_vg = 1;
|
existing_vg = 1;
|
||||||
vg_release(vg_to);
|
vg_release(vg_to);
|
||||||
vg_to = vg_read_for_update(cmd, vg_name_to, NULL,
|
vg_to = vg_read_for_update(cmd, vg_name_to, NULL, 0);
|
||||||
READ_REQUIRE_RESIZEABLE);
|
|
||||||
|
|
||||||
if (vg_read_error(vg_to)) {
|
if (vg_read_error(vg_to)) {
|
||||||
vg_release(vg_to);
|
vg_release(vg_to);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user