summaryrefslogtreecommitdiffstats
path: root/Grow.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 /Grow.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 'Grow.c')
-rw-r--r--Grow.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/Grow.c b/Grow.c
index 0f07a894..e362403a 100644
--- a/Grow.c
+++ b/Grow.c
@@ -2175,7 +2175,7 @@ size_change_error:
devname, s->size);
}
changed = 1;
- } else if (array.level != LEVEL_CONTAINER) {
+ } else if (!is_container(array.level)) {
s->size = get_component_size(fd)/2;
if (s->size == 0)
s->size = array.size;
@@ -2231,7 +2231,7 @@ size_change_error:
info.component_size = s->size*2;
info.new_level = s->level;
info.new_chunk = s->chunk * 1024;
- if (info.array.level == LEVEL_CONTAINER) {
+ if (is_container(info.array.level)) {
info.delta_disks = UnSet;
info.array.raid_disks = s->raiddisks;
} else if (s->raiddisks)
@@ -2344,7 +2344,7 @@ size_change_error:
printf("layout for %s set to %d\n",
devname, array.layout);
}
- } else if (array.level == LEVEL_CONTAINER) {
+ } else if (is_container(array.level)) {
/* This change is to be applied to every array in the
* container. This is only needed when the metadata imposes
* restraints of the various arrays in the container.