#include "mdadm.h"
#ifndef VERSION
-#define VERSION "4.2"
+#define VERSION "4.3"
#endif
#ifndef VERS_DATE
-#define VERS_DATE "2021-12-30"
+#define VERS_DATE "2024-02-15"
#endif
#ifndef EXTRAVERSION
#define EXTRAVERSION ""
{"size", 1, 0, 'z'},
{"auto", 1, 0, Auto}, /* also for --assemble */
{"assume-clean",0,0, AssumeClean },
+ {"write-zeroes",0,0, WriteZeroes },
{"metadata", 1, 0, 'e'}, /* superblock format */
{"bitmap", 1, 0, Bitmap},
{"bitmap-chunk", 1, 0, BitmapChunk},
" --write-journal= : Specify journal device for RAID-4/5/6 array\n"
" --consistency-policy= : Specify the policy that determines how the array\n"
" -k : maintains consistency in case of unexpected shutdown.\n"
+" --write-zeroes : Write zeroes to the disks before creating. This will bypass initial sync.\n"
"\n"
;
;
char Help_manage[] =
-"Usage: mdadm arraydevice options component devices...\n"
+"Usage: mdadm [mode] arraydevice [options] <component devices...>\n"
"\n"
"This usage is for managing the component devices within an array.\n"
"The --manage option is not needed and is assumed if the first argument\n"
[GROW] = Help_grow,
[INCREMENTAL] = Help_incr,
};
+
+/**
+ * fprint_update_options() - Print valid update options depending on the mode.
+ * @outf: File (output stream)
+ * @update_mode: Used to distinguish update and update_subarray
+ */
+void fprint_update_options(FILE *outf, enum update_opt update_mode)
+{
+ int counter = UOPT_NAME, breakpoint = UOPT_HELP;
+ mapping_t *map = update_options;
+
+ if (!outf)
+ return;
+ if (update_mode == UOPT_SUBARRAY_ONLY) {
+ breakpoint = UOPT_SUBARRAY_ONLY;
+ fprintf(outf, "Valid --update options for update-subarray are:\n\t");
+ } else
+ fprintf(outf, "Valid --update options are:\n\t");
+ while (map->num) {
+ if (map->num >= breakpoint)
+ break;
+ fprintf(outf, "'%s', ", map->name);
+ if (counter % 5 == 0)
+ fprintf(outf, "\n\t");
+ counter++;
+ map++;
+ }
+ if ((counter - 1) % 5)
+ fprintf(outf, "\n");
+ fprintf(outf, "\r");
+}