Blame SOURCES/0069-Add-code-specific-update-options-to-enum.patch

91179e
From 2257de106cbf17a7f1df33a10cfd2be0d5a064cb Mon Sep 17 00:00:00 2001
91179e
From: Mateusz Kusiak <mateusz.kusiak@intel.com>
91179e
Date: Mon, 2 Jan 2023 09:35:17 +0100
91179e
Subject: [PATCH 69/83] Add code specific update options to enum.
91179e
91179e
Some of update options aren't taken from user input, but are hard-coded
91179e
as strings.
91179e
Include those options in enum.
91179e
91179e
Signed-off-by: Mateusz Kusiak <mateusz.kusiak@intel.com>
91179e
Signed-off-by: Jes Sorensen <jes@trained-monkey.org>
91179e
---
91179e
 maps.c  | 21 +++++++++++++++++++++
91179e
 mdadm.h | 15 +++++++++++++++
91179e
 2 files changed, 36 insertions(+)
91179e
91179e
diff --git a/maps.c b/maps.c
91179e
index b586679a..c59036f1 100644
91179e
--- a/maps.c
91179e
+++ b/maps.c
91179e
@@ -194,6 +194,27 @@ mapping_t update_options[] = {
91179e
 	{ "byteorder", UOPT_BYTEORDER },
91179e
 	{ "help", UOPT_HELP },
91179e
 	{ "?", UOPT_HELP },
91179e
+	/*
91179e
+	 * Those enries are temporary and will be removed in this patchset.
91179e
+	 *
91179e
+	 * Before update_super:update can be changed to enum,
91179e
+	 * all update_super sub-functions must be adapted first.
91179e
+	 * Update options will be passed as string (as it is for now),
91179e
+	 * and then mapped, so all options must be handled temporarily.
91179e
+	 *
91179e
+	 * Those options code specific and should not be accessible for user.
91179e
+	 */
91179e
+	{ "force-one", UOPT_SPEC_FORCE_ONE },
91179e
+	{ "force-array", UOPT_SPEC_FORCE_ARRAY },
91179e
+	{ "assemble", UOPT_SPEC_ASSEMBLE },
91179e
+	{ "linear-grow-new", UOPT_SPEC_LINEAR_GROW_NEW },
91179e
+	{ "linear-grow-update", UOPT_SPEC_LINEAR_GROW_UPDATE },
91179e
+	{ "_reshape_progress", UOPT_SPEC__RESHAPE_PROGRESS },
91179e
+	{ "writemostly", UOPT_SPEC_WRITEMOSTLY },
91179e
+	{ "readwrite", UOPT_SPEC_READWRITE },
91179e
+	{ "failfast", UOPT_SPEC_FAILFAST },
91179e
+	{ "nofailfast", UOPT_SPEC_NOFAILFAST },
91179e
+	{ "revert-reshape-nobackup", UOPT_SPEC_REVERT_RESHAPE_NOBACKUP },
91179e
 	{ NULL, UOPT_UNDEFINED}
91179e
 };
91179e
 
91179e
diff --git a/mdadm.h b/mdadm.h
91179e
index 51f1db2d..31db25f5 100644
91179e
--- a/mdadm.h
91179e
+++ b/mdadm.h
91179e
@@ -523,6 +523,21 @@ enum update_opt {
91179e
 	UOPT_LAYOUT_UNSPECIFIED,
91179e
 	UOPT_BYTEORDER,
91179e
 	UOPT_HELP,
91179e
+	UOPT_USER_ONLY,
91179e
+	/*
91179e
+	 * Code specific options, cannot be set by the user
91179e
+	 */
91179e
+	UOPT_SPEC_FORCE_ONE,
91179e
+	UOPT_SPEC_FORCE_ARRAY,
91179e
+	UOPT_SPEC_ASSEMBLE,
91179e
+	UOPT_SPEC_LINEAR_GROW_NEW,
91179e
+	UOPT_SPEC_LINEAR_GROW_UPDATE,
91179e
+	UOPT_SPEC__RESHAPE_PROGRESS,
91179e
+	UOPT_SPEC_WRITEMOSTLY,
91179e
+	UOPT_SPEC_READWRITE,
91179e
+	UOPT_SPEC_FAILFAST,
91179e
+	UOPT_SPEC_NOFAILFAST,
91179e
+	UOPT_SPEC_REVERT_RESHAPE_NOBACKUP,
91179e
 	UOPT_UNDEFINED
91179e
 };
91179e
 extern void fprint_update_options(FILE *outf, enum update_opt update_mode);
91179e
-- 
91179e
2.38.1
91179e