diff options
author | Kinga Tanska <kinga.tanska@intel.com> | 2022-09-02 08:49:23 +0200 |
---|---|---|
committer | Jes Sorensen <jsorensen@fb.com> | 2022-09-29 17:04:43 +0200 |
commit | 6f2af6a48c541f207cb727a31fb86de2cd04fc21 (patch) | |
tree | a57f3b9c8d52cd12848f70bc5b2c063f298b8717 /super-ddf.c | |
parent | ReadMe: fix command-line help (diff) | |
download | mdadm-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 'super-ddf.c')
-rw-r--r-- | super-ddf.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/super-ddf.c b/super-ddf.c index 949e7d15..9d1e3b94 100644 --- a/super-ddf.c +++ b/super-ddf.c @@ -3325,7 +3325,7 @@ validate_geometry_ddf_container(struct supertype *st, int fd; unsigned long long ldsize; - if (level != LEVEL_CONTAINER) + if (!is_container(level)) return 0; if (!dev) return 1; @@ -3371,7 +3371,7 @@ static int validate_geometry_ddf(struct supertype *st, if (level == LEVEL_NONE) level = LEVEL_CONTAINER; - if (level == LEVEL_CONTAINER) { + if (is_container(level)) { /* Must be a fresh device to add to a container */ return validate_geometry_ddf_container(st, level, raiddisks, data_offset, dev, @@ -3488,7 +3488,7 @@ static int validate_geometry_ddf_bvd(struct supertype *st, struct dl *dl; unsigned long long maxsize; /* ddf/bvd supports lots of things, but not containers */ - if (level == LEVEL_CONTAINER) { + if (is_container(level)) { if (verbose) pr_err("DDF cannot create a container within an container\n"); return 0; |