linux-raid.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Mateusz Kusiak <mateusz.kusiak@intel.com>
To: linux-raid@vger.kernel.org
Cc: jes@trained-monkey.org, colyli@suse.de
Subject: [PATCH 03/10] Add code specific update options to enum.
Date: Thu, 18 Aug 2022 16:56:14 +0200	[thread overview]
Message-ID: <20220818145621.21982-4-mateusz.kusiak@intel.com> (raw)
In-Reply-To: <20220818145621.21982-1-mateusz.kusiak@intel.com>

Some of update options aren't taken from user input, but are hard-coded
as strings.
Include those options in enum.

Signed-off-by: Mateusz Kusiak <mateusz.kusiak@intel.com>
---
 maps.c  | 21 +++++++++++++++++++++
 mdadm.h | 15 +++++++++++++++
 2 files changed, 36 insertions(+)

diff --git a/maps.c b/maps.c
index b586679a..c59036f1 100644
--- a/maps.c
+++ b/maps.c
@@ -194,6 +194,27 @@ mapping_t update_options[] = {
 	{ "byteorder", UOPT_BYTEORDER },
 	{ "help", UOPT_HELP },
 	{ "?", UOPT_HELP },
+	/*
+	 * Those enries are temporary and will be removed in this patchset.
+	 *
+	 * Before update_super:update can be changed to enum,
+	 * all update_super sub-functions must be adapted first.
+	 * Update options will be passed as string (as it is for now),
+	 * and then mapped, so all options must be handled temporarily.
+	 *
+	 * Those options code specific and should not be accessible for user.
+	 */
+	{ "force-one", UOPT_SPEC_FORCE_ONE },
+	{ "force-array", UOPT_SPEC_FORCE_ARRAY },
+	{ "assemble", UOPT_SPEC_ASSEMBLE },
+	{ "linear-grow-new", UOPT_SPEC_LINEAR_GROW_NEW },
+	{ "linear-grow-update", UOPT_SPEC_LINEAR_GROW_UPDATE },
+	{ "_reshape_progress", UOPT_SPEC__RESHAPE_PROGRESS },
+	{ "writemostly", UOPT_SPEC_WRITEMOSTLY },
+	{ "readwrite", UOPT_SPEC_READWRITE },
+	{ "failfast", UOPT_SPEC_FAILFAST },
+	{ "nofailfast", UOPT_SPEC_NOFAILFAST },
+	{ "revert-reshape-nobackup", UOPT_SPEC_REVERT_RESHAPE_NOBACKUP },
 	{ NULL, UOPT_UNDEFINED}
 };
 
diff --git a/mdadm.h b/mdadm.h
index 43e6b544..7bc31b16 100644
--- a/mdadm.h
+++ b/mdadm.h
@@ -523,6 +523,21 @@ enum update_opt {
 	UOPT_LAYOUT_UNSPECIFIED,
 	UOPT_BYTEORDER,
 	UOPT_HELP,
+	UOPT_USER_ONLY,
+	/*
+	 * Code specific options, cannot be set by the user
+	 */
+	UOPT_SPEC_FORCE_ONE,
+	UOPT_SPEC_FORCE_ARRAY,
+	UOPT_SPEC_ASSEMBLE,
+	UOPT_SPEC_LINEAR_GROW_NEW,
+	UOPT_SPEC_LINEAR_GROW_UPDATE,
+	UOPT_SPEC__RESHAPE_PROGRESS,
+	UOPT_SPEC_WRITEMOSTLY,
+	UOPT_SPEC_READWRITE,
+	UOPT_SPEC_FAILFAST,
+	UOPT_SPEC_NOFAILFAST,
+	UOPT_SPEC_REVERT_RESHAPE_NOBACKUP,
 	UOPT_UNDEFINED
 };
 extern void fprint_update_options(FILE *outf, enum update_opt update_mode);
-- 
2.26.2


  parent reply	other threads:[~2022-08-18 14:57 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-18 14:56 [PATCH 00/10] Block update-subarray and refactor context update Mateusz Kusiak
2022-08-18 14:56 ` [PATCH 01/10] mdadm: Add option validation for --update-subarray Mateusz Kusiak
2022-09-13 15:12   ` Coly Li
2022-09-22 11:21     ` Kusiak, Mateusz
2022-08-18 14:56 ` [PATCH 02/10] Fix --update-subarray on active volume Mateusz Kusiak
2022-09-14 15:02   ` Coly Li
2022-08-18 14:56 ` Mateusz Kusiak [this message]
2022-09-14 15:02   ` [PATCH 03/10] Add code specific update options to enum Coly Li
2022-08-18 14:56 ` [PATCH 04/10] super-ddf: Remove update_super_ddf Mateusz Kusiak
2022-09-14 15:03   ` Coly Li
2022-08-18 14:56 ` [PATCH 05/10] super0: refactor the code for enum Mateusz Kusiak
2022-09-14 15:03   ` Coly Li
2022-09-22 11:21     ` Kusiak, Mateusz
2022-09-22 18:20       ` Jes Sorensen
2022-08-18 14:56 ` [PATCH 06/10] super1: " Mateusz Kusiak
2022-09-14 15:03   ` Coly Li
2022-09-22 11:21     ` Kusiak, Mateusz
2022-12-28 14:29       ` Jes Sorensen
2022-08-18 14:56 ` [PATCH 07/10] super-intel: " Mateusz Kusiak
2022-09-14 15:03   ` Coly Li
2022-09-22 11:22     ` Kusiak, Mateusz
2022-08-18 14:56 ` [PATCH 08/10] Change update to enum in update_super and update_subarray Mateusz Kusiak
2022-09-03  5:57   ` Coly Li
2022-09-14 15:03   ` Coly Li
2022-09-22 11:22     ` Kusiak, Mateusz
2022-08-18 14:56 ` [PATCH 09/10] Manage&Incremental: code refactor, string to enum Mateusz Kusiak
2022-09-14 15:03   ` Coly Li
2022-08-18 14:56 ` [PATCH 10/10] Change char* to enum in context->update & refactor code Mateusz Kusiak
2022-09-14 15:03   ` Coly Li

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220818145621.21982-4-mateusz.kusiak@intel.com \
    --to=mateusz.kusiak@intel.com \
    --cc=colyli@suse.de \
    --cc=jes@trained-monkey.org \
    --cc=linux-raid@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).