From: Alasdair G Kergon Date: Sat, 30 Jul 2016 14:56:17 +0000 (+0100) Subject: lvconvert: Rely upon lp->thin and lp->cache. X-Git-Tag: v2_02_163~58 X-Git-Url: https://sourceware.org/git/?a=commitdiff_plain;h=1ce958bc5ea2827fdb945b2177616e8f253486a1;p=lvm2.git lvconvert: Rely upon lp->thin and lp->cache. --- diff --git a/tools/lvconvert.c b/tools/lvconvert.c index 822df5351..ed3bd8807 100644 --- a/tools/lvconvert.c +++ b/tools/lvconvert.c @@ -4072,7 +4072,7 @@ static int _convert_thin_pool(struct cmd_context *cmd, struct logical_volume *lv if (arg_is_set(cmd, uncache_ARG)) return _convert_thin_pool_uncache(cmd, lv, lp); - if (!strcmp(lp->type_str, SEG_TYPE_NAME_CACHE) || arg_is_set(cmd, cache_ARG)) + if (lp->cache) return _convert_thin_pool_cache(cmd, lv, lp); if (arg_is_set(cmd, repair_ARG)) @@ -4216,10 +4216,10 @@ static int _convert_raid(struct cmd_context *cmd, struct logical_volume *lv, if (!strcmp(lp->type_str, SEG_TYPE_NAME_SNAPSHOT) || arg_is_set(cmd, snapshot_ARG)) return _convert_raid_snapshot(cmd, lv, lp); - if (!strcmp(lp->type_str, SEG_TYPE_NAME_THIN) || arg_is_set(cmd, thin_ARG)) + if (lp->thin) return _convert_raid_thin(cmd, lv, lp); - if (!strcmp(lp->type_str, SEG_TYPE_NAME_CACHE) || arg_is_set(cmd, cache_ARG)) + if (lp->cache) return _convert_raid_cache(cmd, lv, lp); /* Using --thinpool is ambiguous and not preferred. */ @@ -4273,10 +4273,10 @@ static int _convert_striped(struct cmd_context *cmd, struct logical_volume *lv, if (!strcmp(lp->type_str, SEG_TYPE_NAME_SNAPSHOT) || arg_is_set(cmd, snapshot_ARG)) return _convert_striped_snapshot(cmd, lv, lp); - if (!strcmp(lp->type_str, SEG_TYPE_NAME_THIN) || lp->thin) + if (lp->thin) return _convert_striped_thin(cmd, lv, lp); - if (!strcmp(lp->type_str, SEG_TYPE_NAME_CACHE) || arg_is_set(cmd, cache_ARG)) + if (lp->cache) return _convert_striped_cache(cmd, lv, lp); /* Using --thinpool is ambiguous and not preferred. */