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

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