From 2c3bbf0a6cf33de8f1b2a08fcb79da3f881d3472 Mon Sep 17 00:00:00 2001 From: Zdenek Kabelac Date: Thu, 15 Nov 2012 14:47:37 +0100 Subject: [PATCH] cleanup: move setting of parameter zero Since we may need to use different default value, move read of zero_ARG prior processing of parameters. --- tools/lvcreate.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/tools/lvcreate.c b/tools/lvcreate.c index 3ea8f4670..5d687acff 100644 --- a/tools/lvcreate.c +++ b/tools/lvcreate.c @@ -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);