mirror of
git://sourceware.org/git/lvm2.git
synced 2024-12-21 13:34:40 +03:00
cleanup: move lv assignment
Use shorter lv->.
This commit is contained in:
parent
f5a3bef276
commit
d0def236d6
@ -386,25 +386,27 @@ static int _lvresize(struct cmd_context *cmd, struct volume_group *vg,
|
|||||||
return ECMD_FAILED;
|
return ECMD_FAILED;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (lv_is_external_origin(lvl->lv)) {
|
lv = lvl->lv;
|
||||||
|
|
||||||
|
if (lv_is_external_origin(lv)) {
|
||||||
/*
|
/*
|
||||||
* Since external-origin can be activated read-only,
|
* Since external-origin can be activated read-only,
|
||||||
* there is no way to use extended areas.
|
* there is no way to use extended areas.
|
||||||
*/
|
*/
|
||||||
log_error("Cannot resize external origin \"%s\".", lvl->lv->name);
|
log_error("Cannot resize external origin \"%s\".", lv->name);
|
||||||
return EINVALID_CMD_LINE;
|
return EINVALID_CMD_LINE;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (lvl->lv->status & (RAID_IMAGE | RAID_META)) {
|
if (lv->status & (RAID_IMAGE | RAID_META)) {
|
||||||
log_error("Cannot resize a RAID %s directly",
|
log_error("Cannot resize a RAID %s directly",
|
||||||
(lvl->lv->status & RAID_IMAGE) ? "image" :
|
(lv->status & RAID_IMAGE) ? "image" :
|
||||||
"metadata area");
|
"metadata area");
|
||||||
return ECMD_FAILED;
|
return ECMD_FAILED;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (lv_is_raid_with_tracking(lvl->lv)) {
|
if (lv_is_raid_with_tracking(lv)) {
|
||||||
log_error("Cannot resize %s while it is tracking a split image",
|
log_error("Cannot resize %s while it is tracking a split image",
|
||||||
lvl->lv->name);
|
lv->name);
|
||||||
return ECMD_FAILED;
|
return ECMD_FAILED;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -430,8 +432,6 @@ static int _lvresize(struct cmd_context *cmd, struct volume_group *vg,
|
|||||||
!_validate_stripesize(cmd, vg, lp))
|
!_validate_stripesize(cmd, vg, lp))
|
||||||
return EINVALID_CMD_LINE;
|
return EINVALID_CMD_LINE;
|
||||||
|
|
||||||
lv = lvl->lv;
|
|
||||||
|
|
||||||
if (use_policy) {
|
if (use_policy) {
|
||||||
if (!lv_is_cow(lv) &&
|
if (!lv_is_cow(lv) &&
|
||||||
!lv_is_thin_pool(lv)) {
|
!lv_is_thin_pool(lv)) {
|
||||||
@ -817,7 +817,7 @@ static int _lvresize(struct cmd_context *cmd, struct volume_group *vg,
|
|||||||
|
|
||||||
log_print_unless_silent("%sing logical volume %s to %s",
|
log_print_unless_silent("%sing logical volume %s to %s",
|
||||||
(lp->resize == LV_REDUCE) ? "Reduc" : "Extend",
|
(lp->resize == LV_REDUCE) ? "Reduc" : "Extend",
|
||||||
lp->lv_name,
|
lv->name,
|
||||||
display_size(cmd, (uint64_t) lp->extents * vg->extent_size));
|
display_size(cmd, (uint64_t) lp->extents * vg->extent_size));
|
||||||
|
|
||||||
if (lp->resize == LV_REDUCE) {
|
if (lp->resize == LV_REDUCE) {
|
||||||
@ -848,7 +848,7 @@ static int _lvresize(struct cmd_context *cmd, struct volume_group *vg,
|
|||||||
lock_lv = lv;
|
lock_lv = lv;
|
||||||
|
|
||||||
if (!suspend_lv(cmd, lock_lv)) {
|
if (!suspend_lv(cmd, lock_lv)) {
|
||||||
log_error("Failed to suspend %s", lp->lv_name);
|
log_error("Failed to suspend %s", lock_lv->name);
|
||||||
vg_revert(vg);
|
vg_revert(vg);
|
||||||
backup(vg);
|
backup(vg);
|
||||||
return ECMD_FAILED;
|
return ECMD_FAILED;
|
||||||
@ -863,7 +863,7 @@ static int _lvresize(struct cmd_context *cmd, struct volume_group *vg,
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!resume_lv(cmd, lock_lv)) {
|
if (!resume_lv(cmd, lock_lv)) {
|
||||||
log_error("Problem reactivating %s", lp->lv_name);
|
log_error("Problem reactivating %s", lock_lv->name);
|
||||||
backup(vg);
|
backup(vg);
|
||||||
return ECMD_FAILED;
|
return ECMD_FAILED;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user