mirror of
git://sourceware.org/git/lvm2.git
synced 2025-01-03 05:18:29 +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:
parent
c77197c688
commit
355258be58
@ -211,11 +211,13 @@ static int _check_conversion_type(struct cmd_context *cmd, const char *type_str)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* -s/--snapshot and --type snapshot are synonyms */
|
/* -s/--snapshot and --type snapshot are synonyms */
|
||||||
#define snapshot_type_requested(cmd,type_str) (arg_count(cmd, snapshot_ARG) || \
|
static inline int snapshot_type_requested(struct cmd_context *cmd, const char *type_str) {
|
||||||
!strcmp(type_str, "snapshot"))
|
return (arg_count(cmd, snapshot_ARG) || !strcmp(type_str, "snapshot"));
|
||||||
|
}
|
||||||
/* mirror/raid* (1,10,4,5,6 and their variants) reshape */
|
/* 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) || \
|
static inline int mirror_or_raid_type_requested(struct cmd_context *cmd, const char *type_str) {
|
||||||
!strncmp(type_str, "raid", 4))
|
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,
|
static int _read_params(struct lvconvert_params *lp, struct cmd_context *cmd,
|
||||||
int argc, char **argv)
|
int argc, char **argv)
|
||||||
|
Loading…
Reference in New Issue
Block a user