diff options
author | Mateusz Kusiak <mateusz.kusiak@intel.com> | 2023-01-02 09:35:22 +0100 |
---|---|---|
committer | Jes Sorensen <jes@trained-monkey.org> | 2023-01-04 16:20:58 +0100 |
commit | 03312b5240438ffc3b63114bdc87e911222f01e5 (patch) | |
tree | 6efdf29991cfc40cdbc320f31c33bf158b05fd0f /super0.c | |
parent | super-intel: refactor the code for enum (diff) | |
download | mdadm-03312b5240438ffc3b63114bdc87e911222f01e5.tar.xz mdadm-03312b5240438ffc3b63114bdc87e911222f01e5.zip |
Change update to enum in update_super and update_subarray
Use already existing enum, change update_super and update_subarray
update to enum globally.
Refactor function references also.
Remove code specific options from update_options.
Signed-off-by: Mateusz Kusiak <mateusz.kusiak@intel.com>
Signed-off-by: Jes Sorensen <jes@trained-monkey.org>
Diffstat (limited to 'super0.c')
-rw-r--r-- | super0.c | 9 |
1 files changed, 4 insertions, 5 deletions
@@ -491,7 +491,7 @@ static struct mdinfo *container_content0(struct supertype *st, char *subarray) } static int update_super0(struct supertype *st, struct mdinfo *info, - char *update, + enum update_opt update, char *devname, int verbose, int uuid_set, char *homehost) { @@ -502,20 +502,19 @@ static int update_super0(struct supertype *st, struct mdinfo *info, int rv = 0; int uuid[4]; mdp_super_t *sb = st->sb; - enum update_opt update_enum = map_name(update_options, update); - if (update_enum == UOPT_HOMEHOST && homehost) { + if (update == UOPT_HOMEHOST && homehost) { /* * note that 'homehost' is special as it is really * a "uuid" update. */ uuid_set = 0; - update_enum = UOPT_UUID; + update = UOPT_UUID; info->uuid[0] = sb->set_uuid0; info->uuid[1] = sb->set_uuid1; } - switch (update_enum) { + switch (update) { case UOPT_UUID: if (!uuid_set && homehost) { char buf[20]; |