summaryrefslogtreecommitdiffstats
path: root/Assemble.c
diff options
context:
space:
mode:
authorKinga Tanska <kinga.tanska@intel.com>2022-09-02 08:49:23 +0200
committerJes Sorensen <jsorensen@fb.com>2022-09-29 17:04:43 +0200
commit6f2af6a48c541f207cb727a31fb86de2cd04fc21 (patch)
treea57f3b9c8d52cd12848f70bc5b2c063f298b8717 /Assemble.c
parentReadMe: fix command-line help (diff)
downloadmdadm-6f2af6a48c541f207cb727a31fb86de2cd04fc21.tar.xz
mdadm-6f2af6a48c541f207cb727a31fb86de2cd04fc21.zip
mdadm: replace container level checking with inline
To unify all containers checks in code, is_container() function is added and propagated. Signed-off-by: Kinga Tanska <kinga.tanska@intel.com> Acked-by: Coly Li <colyli@suse.de> Signed-off-by: Jes Sorensen <jsorensen@fb.com>
Diffstat (limited to 'Assemble.c')
-rw-r--r--Assemble.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/Assemble.c b/Assemble.c
index 1dd82a8c..8b0af0c9 100644
--- a/Assemble.c
+++ b/Assemble.c
@@ -1120,7 +1120,7 @@ static int start_array(int mdfd,
i/2, mddev);
}
- if (content->array.level == LEVEL_CONTAINER) {
+ if (is_container(content->array.level)) {
sysfs_rules_apply(mddev, content);
if (c->verbose >= 0) {
pr_err("Container %s has been assembled with %d drive%s",
@@ -1549,8 +1549,7 @@ try_again:
*/
trustworthy = LOCAL;
- if (name[0] == 0 &&
- content->array.level == LEVEL_CONTAINER) {
+ if (!name[0] && is_container(content->array.level)) {
name = content->text_version;
trustworthy = METADATA;
}
@@ -1809,7 +1808,7 @@ try_again:
}
#endif
}
- if (c->force && !clean && content->array.level != LEVEL_CONTAINER &&
+ if (c->force && !clean && !is_container(content->array.level) &&
!enough(content->array.level, content->array.raid_disks,
content->array.layout, clean, avail)) {
change += st->ss->update_super(st, content, "force-array",