mdadm/0069-Add-code-specific-update-options-to-enum.patch
Coly Li 058b24e58a Accepting request 1137473 from home:colyli:branches:Base:System
- Update mdadm to latest upstream state upto commit
  582945c2d3bb. (jsc#PED-7542)
  1) The testing changes are not included here.
  2) Code clean up, and more helper routines added for Manage.c,
     Monitor.c, mdadm.c, ReadMe.c, super-intel.c, super0.c, super1.c,
     Create.c, Incremental.c and so on.
  3) Man page update for mdadm.8.in.
  4) Several memory leak and double free fixes.
  5) Check /etc/initrd-release for whether systemd running on an initrd.
  - Manage: Block unsafe member failing
    0062-Manage-Block-unsafe-member-failing.patch
  - Mdmonitor: Split alert() into separate functions
    0063-Mdmonitor-Split-alert-into-separate-functions.patch
  - Monitor: block if monitor modes are combined.
    0064-Monitor-block-if-monitor-modes-are-combined.patch
  - Update mdadm Monitor manual.
    0065-Update-mdadm-Monitor-manual.patch
  - mdadm: create ident_init()
    0066-mdadm-create-ident_init.patch
  - mdadm: Add option validation for --update-subarray
    0067-mdadm-Add-option-validation-for-update-subarray.patch
  - Fix --update-subarray on active volume
    0068-Fix-update-subarray-on-active-volume.patch
  - Add code specific update options to enum.
    0069-Add-code-specific-update-options-to-enum.patch
  - super-ddf: Remove update_super_ddf.
    0070-super-ddf-Remove-update_super_ddf.patch
  - super0: refactor the code for enum
    0071-super0-refactor-the-code-for-enum.patch
  - super1: refactor the code for enum

OBS-URL: https://build.opensuse.org/request/show/1137473
OBS-URL: https://build.opensuse.org/package/show/Base:System/mdadm?expand=0&rev=231
2024-01-11 00:49:23 +00:00

78 lines
2.3 KiB
Diff

From 2257de106cbf17a7f1df33a10cfd2be0d5a064cb Mon Sep 17 00:00:00 2001
From: Mateusz Kusiak <mateusz.kusiak@intel.com>
Date: Mon, 2 Jan 2023 09:35:17 +0100
Subject: [PATCH] Add code specific update options to enum.
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>
Signed-off-by: Jes Sorensen <jes@trained-monkey.org>
---
maps.c | 21 +++++++++++++++++++++
mdadm.h | 15 +++++++++++++++
2 files changed, 36 insertions(+)
diff --git a/maps.c b/maps.c
index b586679..c59036f 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 51f1db2..31db25f 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.35.3