summaryrefslogtreecommitdiff
path: root/util.c
diff options
context:
space:
mode:
authorGuoqing Jiang <gqjiang@suse.com>2017-10-30 17:09:51 +0800
committerJes Sorensen <jsorensen@fb.com>2017-11-09 11:56:10 -0500
commit5339f99606f19ce1eeadebf3c0849933dc0c6fd5 (patch)
tree8290740d24d5b0f84ab72db9f972139147d9bdf0 /util.c
parent01a052b9c1c6bdc7307a3f8e8d12db262d9b258c (diff)
downloadmdadm-5339f99606f19ce1eeadebf3c0849933dc0c6fd5.tar.gz
To support clustered raid10
We are now considering to extend clustered raid to support raid10. But only near layout is supported, so make the check when create the array or switch the bitmap from internal to clustered. Signed-off-by: Guoqing Jiang <gqjiang@suse.com> Signed-off-by: Jes Sorensen <jsorensen@fb.com>
Diffstat (limited to 'util.c')
-rw-r--r--util.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/util.c b/util.c
index c11729e..543ec6c 100644
--- a/util.c
+++ b/util.c
@@ -397,6 +397,17 @@ unsigned long long parse_size(char *size)
return s;
}
+int is_near_layout_10(int layout)
+{
+ int fc, fo;
+
+ fc = (layout >> 8) & 255;
+ fo = layout & (1 << 16);
+ if (fc > 1 || fo > 0)
+ return 0;
+ return 1;
+}
+
int parse_layout_10(char *layout)
{
int copies, rv;