]> sourceware.org Git - lvm2.git/commitdiff
cleanup: move setting of parameter zero
authorZdenek Kabelac <zkabelac@redhat.com>
Thu, 15 Nov 2012 13:47:37 +0000 (14:47 +0100)
committerZdenek Kabelac <zkabelac@redhat.com>
Mon, 19 Nov 2012 13:15:43 +0000 (14:15 +0100)
Since we may need to use different default value,
move read of zero_ARG prior processing of parameters.

tools/lvcreate.c

index 3ea8f467030bea4875e15ab2e3126a3e60be0f16..5d687acff10f5f2cdbd8efb71c1b32c43a82fc91 100644 (file)
@@ -812,6 +812,12 @@ static int _lvcreate_params(struct lvcreate_params *lp,
                }
        }
 
+       /*
+        * Should we zero the lv.
+        */
+       lp->zero = strcmp(arg_str_value(cmd, zero_ARG,
+               (lp->segtype->flags & SEG_CANNOT_BE_ZEROED) ? "n" : "y"), "n");
+
        if (!_lvcreate_name_params(lp, cmd, &argc, &argv) ||
            !_read_size_params(lp, lcp, cmd) ||
            !get_stripe_params(cmd, &lp->stripes, &lp->stripe_size) ||
@@ -877,12 +883,6 @@ static int _lvcreate_params(struct lvcreate_params *lp,
                return 0;
        }
 
-       /*
-        * Should we zero the lv.
-        */
-       lp->zero = strcmp(arg_str_value(cmd, zero_ARG,
-               (lp->segtype->flags & SEG_CANNOT_BE_ZEROED) ? "n" : "y"), "n");
-
        if (lp->mirrors > DEFAULT_MIRROR_MAX_IMAGES) {
                log_error("Only up to %d images in mirror supported currently.",
                          DEFAULT_MIRROR_MAX_IMAGES);
This page took 0.042018 seconds and 5 git commands to generate.