1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-21 13:34:40 +03:00

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.
This commit is contained in:
Zdenek Kabelac 2014-07-01 10:13:10 +02:00
parent c77197c688
commit 355258be58

View File

@ -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)