summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZdenek Kabelac <zkabelac@redhat.com>2016-06-15 11:35:16 +0200
committerZdenek Kabelac <zkabelac@redhat.com>2016-06-23 14:57:08 +0200
commit0a525832f9902f6268d155f22975653f27877816 (patch)
treea3261e7cbacbf4ac73e23a39a0dc33dd3670c9c1
parent3a4107c982e706dd97117e7e182bf9cbf7e85cac (diff)
downloadlvm2-0a525832f9902f6268d155f22975653f27877816.tar.gz
cleanup: code lines reodered
-rw-r--r--tools/lvresize.c16
1 files changed, 7 insertions, 9 deletions
diff --git a/tools/lvresize.c b/tools/lvresize.c
index 9fb35bdd4..ee6678fd7 100644
--- a/tools/lvresize.c
+++ b/tools/lvresize.c
@@ -18,21 +18,19 @@
static int _lvresize_params(struct cmd_context *cmd, int argc, char **argv,
struct lvresize_params *lp)
{
- const char *cmd_name;
+ const char *cmd_name = command_name(cmd);
char *st;
- int use_policy = arg_is_set(cmd, usepolicies_ARG);
- lp->sign = SIGN_NONE;
- lp->poolmetadatasign = SIGN_NONE;
- lp->resize = LV_ANY;
-
- cmd_name = command_name(cmd);
if (!strcmp(cmd_name, "lvreduce"))
lp->resize = LV_REDUCE;
- if (!strcmp(cmd_name, "lvextend"))
+ else if (!strcmp(cmd_name, "lvextend"))
lp->resize = LV_EXTEND;
+ else
+ lp->resize = LV_ANY;
+
+ lp->sign = lp->poolmetadatasign = SIGN_NONE;
- if (use_policy) {
+ if ((lp->ac_policy = arg_is_set(cmd, usepolicies_ARG))) {
/* do nothing; _lvresize will handle --use-policies itself */
lp->extents = 0;
lp->sign = SIGN_PLUS;