summaryrefslogtreecommitdiffstats
path: root/config.c
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2023-02-25 16:18:46 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2023-02-25 16:18:46 +0000
commitbf5c2aa1d837ea8bb6a4c379ac125b1a41efc9bf (patch)
treeabe74458156206a4adf2950b1cbcad241a72e80e /config.c
parentAdding upstream version 4.2. (diff)
downloadmdadm-bf5c2aa1d837ea8bb6a4c379ac125b1a41efc9bf.tar.xz
mdadm-bf5c2aa1d837ea8bb6a4c379ac125b1a41efc9bf.zip
Adding upstream version 4.2+20230223.upstream/4.2+20230223
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'config.c')
-rw-r--r--config.c52
1 files changed, 30 insertions, 22 deletions
diff --git a/config.c b/config.c
index 9c72545..eeedd0c 100644
--- a/config.c
+++ b/config.c
@@ -119,6 +119,34 @@ int match_keyword(char *word)
return -1;
}
+/**
+ * ident_init() - Set defaults.
+ * @ident: ident pointer, not NULL.
+ */
+inline void ident_init(struct mddev_ident *ident)
+{
+ assert(ident);
+
+ ident->assembled = false;
+ ident->autof = 0;
+ ident->bitmap_fd = -1;
+ ident->bitmap_file = NULL;
+ ident->container = NULL;
+ ident->devices = NULL;
+ ident->devname = NULL;
+ ident->level = UnSet;
+ ident->member = NULL;
+ ident->name[0] = 0;
+ ident->next = NULL;
+ ident->raid_disks = UnSet;
+ ident->spare_group = NULL;
+ ident->spare_disks = 0;
+ ident->st = NULL;
+ ident->super_minor = UnSet;
+ ident->uuid[0] = 0;
+ ident->uuid_set = 0;
+}
+
struct conf_dev {
struct conf_dev *next;
char *name;
@@ -194,7 +222,6 @@ struct mddev_dev *load_containers(void)
struct createinfo createinfo = {
.autof = 2, /* by default, create devices with standard names */
- .symlinks = 1,
.names = 0, /* By default, stick with numbered md devices. */
.bblist = 1, /* Use a bad block list by default */
#ifdef DEBIAN
@@ -310,11 +337,7 @@ static void createline(char *line)
if (!createinfo.supertype)
pr_err("metadata format %s unknown, ignoring\n",
w+9);
- } else if (strncasecmp(w, "symlinks=yes", 12) == 0)
- createinfo.symlinks = 1;
- else if (strncasecmp(w, "symlinks=no", 11) == 0)
- createinfo.symlinks = 0;
- else if (strncasecmp(w, "names=yes", 12) == 0)
+ } else if (strncasecmp(w, "names=yes", 12) == 0)
createinfo.names = 1;
else if (strncasecmp(w, "names=no", 11) == 0)
createinfo.names = 0;
@@ -368,22 +391,7 @@ void arrayline(char *line)
struct mddev_ident mis;
struct mddev_ident *mi;
- mis.uuid_set = 0;
- mis.super_minor = UnSet;
- mis.level = UnSet;
- mis.raid_disks = UnSet;
- mis.spare_disks = 0;
- mis.devices = NULL;
- mis.devname = NULL;
- mis.spare_group = NULL;
- mis.autof = 0;
- mis.next = NULL;
- mis.st = NULL;
- mis.bitmap_fd = -1;
- mis.bitmap_file = NULL;
- mis.name[0] = 0;
- mis.container = NULL;
- mis.member = NULL;
+ ident_init(&mis);
for (w = dl_next(line); w != line; w = dl_next(w)) {
if (w[0] == '/' || strchr(w, '=') == NULL) {