]> sourceware.org Git - lvm2.git/commitdiff
lvconvert: Rely upon lp->thin and lp->cache.
authorAlasdair G Kergon <agk@redhat.com>
Sat, 30 Jul 2016 14:56:17 +0000 (15:56 +0100)
committerAlasdair G Kergon <agk@redhat.com>
Sat, 30 Jul 2016 14:58:09 +0000 (15:58 +0100)
tools/lvconvert.c

index 822df5351e3795cee92ffc51734a11f077e83973..ed3bd88077de7ac629ba881b8374b0f69ac98d95 100644 (file)
@@ -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. */
This page took 0.038721 seconds and 5 git commands to generate.