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

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