diff options
author | Zdenek Kabelac <zkabelac@redhat.com> | 2017-11-10 21:48:33 +0100 |
---|---|---|
committer | Zdenek Kabelac <zkabelac@redhat.com> | 2017-11-15 21:00:29 +0100 |
commit | 0f0dc1a2a5f779fbdae7bddd12c3e56397636833 (patch) | |
tree | 82bdad7c0f56980e7a2d20411ce792202d98ac0f /tools/pvmove.c | |
parent | b978f505ff05c3581ccc633442b04c5d391add04 (diff) | |
download | lvm2-0f0dc1a2a5f779fbdae7bddd12c3e56397636833.tar.gz |
pvmove: remove unusued code
Support for snapshot and cache LVs should now work.
Remove protection rejecting pvmove for them.
Diffstat (limited to 'tools/pvmove.c')
-rw-r--r-- | tools/pvmove.c | 68 |
1 files changed, 0 insertions, 68 deletions
diff --git a/tools/pvmove.c b/tools/pvmove.c index ff36b5521..7bf1713c8 100644 --- a/tools/pvmove.c +++ b/tools/pvmove.c @@ -303,32 +303,6 @@ static int _sub_lv_of(struct logical_volume *lv, const char *lv_name) return _sub_lv_of(seg->lv, lv_name); } -/* - * parent_lv_is_cache_type - * - * FIXME: This function can be removed when 'pvmove' is supported for - * cache types. - * - * If this LV is below a cache LV (at any depth), return 1. - */ -static int _parent_lv_is_cache_type(struct logical_volume *lv) -{ - struct lv_segment *seg; - - /* Sub-LVs only ever have one segment using them */ - if (dm_list_size(&lv->segs_using_this_lv) != 1) - return 0; - - if (!(seg = get_only_segment_using_this_lv(lv))) - return_0; - - if (lv_is_cache_type(seg->lv)) - return 1; - - /* Continue up the tree */ - return _parent_lv_is_cache_type(seg->lv); -} - /* Create new LV with mirror segments for the required copies */ static struct logical_volume *_set_up_pvmove_lv(struct cmd_context *cmd, struct volume_group *vg, @@ -450,48 +424,6 @@ static struct logical_volume *_set_up_pvmove_lv(struct cmd_context *cmd, if (!lv_is_on_pvs(lv, source_pvl)) continue; - if (lv_is_cache_type(lv)) { - log_print_unless_silent("Skipping %s LV, %s.", - lv_is_cache(lv) ? "cache" : - lv_is_cache_pool(lv) ? - "cache-pool" : "cache-related", - lv->name); - lv_skipped = 1; - continue; - } - - if (_parent_lv_is_cache_type(lv)) { - log_print_unless_silent("Skipping %s because a parent" - " is of cache type.", lv->name); - lv_skipped = 1; - continue; - } - - /* - * If the VG is clustered, we are unable to handle - * snapshots, origins, thin types, RAID or mirror - */ - if ((vg_is_clustered(vg) || is_lockd_type(vg->lock_type)) && - (lv_is_origin(lv) || lv_is_cow(lv) || - lv_is_thin_type(lv) || lv_is_raid_type(lv))) { - log_print_unless_silent("Skipping %s LV %s.", - lv_is_origin(lv) ? "origin" : - lv_is_cow(lv) ? - "snapshot-related" : - lv_is_thin_volume(lv) ? "thin" : - lv_is_thin_pool(lv) ? - "thin-pool" : - lv_is_thin_type(lv) ? - "thin-related" : - seg_is_raid(first_seg(lv)) ? - "RAID" : - lv_is_raid_type(lv) ? - "RAID-related" : "", - lv->name); - lv_skipped = 1; - continue; - } - seg = first_seg(lv); if (seg_is_raid(seg) || seg_is_mirrored(seg) || lv_is_thin_volume(lv) || lv_is_thin_pool(lv)) { |