From 702eb8bf57b076e15e074f6a0c6fd04fb62546d9 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Thu, 12 Dec 2024 18:22:06 +0100 Subject: Adding upstream version 4.3+20241202. Signed-off-by: Daniel Baumann --- config.c | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) (limited to 'config.c') diff --git a/config.c b/config.c index 3359504..8a8ae5e 100644 --- a/config.c +++ b/config.c @@ -171,8 +171,7 @@ inline void ident_init(struct mddev_ident *ident) assert(ident); ident->assembled = false; - ident->bitmap_fd = -1; - ident->bitmap_file = NULL; + ident->btype = BitmapUnknown; ident->container = NULL; ident->devices = NULL; ident->devname = NULL; @@ -542,11 +541,19 @@ void arrayline(char *line) /* Ignore name in confile */ continue; } else if (strncasecmp(w, "bitmap=", 7) == 0) { - if (mis.bitmap_file) + if (mis.btype != BitmapUnknown) pr_err("only specify bitmap file once. %s ignored\n", w); - else - mis.bitmap_file = xstrdup(w + 7); + else { + char *bname = xstrdup(w + 7); + + if (strcmp(bname, STR_COMMON_NONE) == 0) + mis.btype = BitmapNone; + else if (strcmp(bname, "internal") == 0) + mis.btype = BitmapInternal; + else if (strcmp(bname, "clustered") == 0) + mis.btype = BitmapCluster; + } } else if (strncasecmp(w, "devices=", 8 ) == 0) { if (mis.devices) -- cgit v1.2.3