1
0
mirror of git://sourceware.org/git/lvm2.git synced 2025-01-03 05:18:29 +03:00

cleanup: move common condition

This commit is contained in:
Zdenek Kabelac 2021-03-14 13:15:24 +01:00
parent b563c926ba
commit fab9987ad7

View File

@ -6834,12 +6834,12 @@ int lv_remove_with_dependencies(struct cmd_context *cmd, struct logical_volume *
struct lv_list *lvl;
struct logical_volume *origin;
if (lv_is_cow(lv)) {
if (!level && lv_is_cow(lv)) {
/*
* A merging snapshot cannot be removed directly unless
* it has been invalidated or failed merge removal is requested.
*/
if (lv_is_merging_cow(lv) && !level) {
if (lv_is_merging_cow(lv)) {
if (lv_info(lv->vg->cmd, lv, 0, &info, 1, 0) &&
info.exists && info.live_table) {
if (!lv_snapshot_percent(lv, &snap_percent)) {
@ -6864,7 +6864,7 @@ int lv_remove_with_dependencies(struct cmd_context *cmd, struct logical_volume *
display_lvname(origin_from_cow(lv))) == 'n')
goto no_remove;
}
} else if (!level && lv_is_virtual_origin(origin = origin_from_cow(lv)))
} else if (lv_is_virtual_origin(origin = origin_from_cow(lv)))
/* If this is a sparse device, remove its origin too. */
/* Stacking is not supported */
lv = origin;