From 355258be58fe52df0e90cb3831bc0e09f06d2e2a Mon Sep 17 00:00:00 2001 From: Zdenek Kabelac Date: Tue, 1 Jul 2014 10:13:10 +0200 Subject: [PATCH] mirror: mirror_or_raid_type_requested update mirror_or_raid_type_requested really checks for mirror type. Convert macros mirror_or_raid_type_requested() and snapshot_type_requested() into inline functions. --- tools/lvconvert.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/tools/lvconvert.c b/tools/lvconvert.c index d0555b3cb..28cbb3295 100644 --- a/tools/lvconvert.c +++ b/tools/lvconvert.c @@ -211,11 +211,13 @@ static int _check_conversion_type(struct cmd_context *cmd, const char *type_str) } /* -s/--snapshot and --type snapshot are synonyms */ -#define snapshot_type_requested(cmd,type_str) (arg_count(cmd, snapshot_ARG) || \ - !strcmp(type_str, "snapshot")) +static inline int snapshot_type_requested(struct cmd_context *cmd, const char *type_str) { + return (arg_count(cmd, snapshot_ARG) || !strcmp(type_str, "snapshot")); +} /* mirror/raid* (1,10,4,5,6 and their variants) reshape */ -#define mirror_or_raid_type_requested(cmd,type_str) (arg_count(cmd, mirrors_ARG) || \ - !strncmp(type_str, "raid", 4)) +static inline int mirror_or_raid_type_requested(struct cmd_context *cmd, const char *type_str) { + return (arg_count(cmd, mirrors_ARG) || !strncmp(type_str, "raid", 4) || !strcmp(type_str, "mirror")); +} static int _read_params(struct lvconvert_params *lp, struct cmd_context *cmd, int argc, char **argv)