mirror of
git://sourceware.org/git/lvm2.git
synced 2024-12-21 13:34:40 +03:00
cleanup: relocate check for mirror
Move testing code into _lvconvert_snapshot function.
This commit is contained in:
parent
b738260c7c
commit
d686f3856a
@ -2038,6 +2038,11 @@ static int _lvconvert_snapshot(struct cmd_context *cmd,
|
||||
{
|
||||
struct logical_volume *org;
|
||||
|
||||
if (lv->status & MIRRORED) {
|
||||
log_error("Unable to convert mirrored LV \"%s\" into a snapshot.", lv->name);
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (lv_is_origin(lv)) {
|
||||
/* Unsupported stack */
|
||||
log_error("Unable to convert origin \"%s\" into a snapshot.", lv->name);
|
||||
@ -3039,10 +3044,6 @@ static int _lvconvert_single(struct cmd_context *cmd, struct logical_volume *lv,
|
||||
return ECMD_FAILED;
|
||||
}
|
||||
} else if (lp->snapshot) {
|
||||
if (lv->status & MIRRORED) {
|
||||
log_error("Unable to convert mirrored LV \"%s\" into a snapshot.", lv->name);
|
||||
return ECMD_FAILED;
|
||||
}
|
||||
if (!_lvconvert_snapshot(cmd, lv, lp))
|
||||
return_ECMD_FAILED;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user