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

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