summaryrefslogtreecommitdiffstats
path: root/mdadm.h
diff options
context:
space:
mode:
authorNeilBrown <neilb@suse.de>2008-08-19 17:55:15 +1000
committerNeilBrown <neilb@suse.de>2008-08-19 17:55:15 +1000
commite9dd159873cfa0da1ec3e4f173c24f330ea526f8 (patch)
treef95abf6b0736b9f7a0bd3743d037bc8f3f7b793d /mdadm.h
parent3c558363a1991430e8a9e10c93ee9ee3f8996940 (diff)
downloadmdadm-e9dd159873cfa0da1ec3e4f173c24f330ea526f8.tar.gz
mdadm-e9dd159873cfa0da1ec3e4f173c24f330ea526f8.tar.xz
mdadm-e9dd159873cfa0da1ec3e4f173c24f330ea526f8.zip
Allow an externally managed array to be marked readonly
If the metadata_version is -mdXXX/whatever rather than /mdXXX/whatever then the array is readonly and should be left alone by mdmon. Signed-off-by: NeilBrown <neilb@suse.de>
Diffstat (limited to 'mdadm.h')
-rw-r--r--mdadm.h9
1 files changed, 8 insertions, 1 deletions
diff --git a/mdadm.h b/mdadm.h
index 489fe30..4fbde1c 100644
--- a/mdadm.h
+++ b/mdadm.h
@@ -807,7 +807,14 @@ static inline int ROUND_UP(int a, int base)
static inline int is_subarray(char *vers)
{
- return (*vers == '/');
+ /* The version string for a 'subarray' (an array in a container)
+ * is
+ * /containername/componentname for normal read-write arrays
+ * -containername/componentname for read-only arrays.
+ * containername is e.g. md0, md_d1
+ * componentname is dependant on the metadata. e.g. '1' 'S1' ...
+ */
+ return (*vers == '/' || *vers == '-');
}
#define LEVEL_MULTIPATH (-4)