]> git.ipfire.org Git - thirdparty/mdadm.git/blobdiff - mdadm.h
Allow metadata handlers to communicate desired safemode delay via mdinfo
[thirdparty/mdadm.git] / mdadm.h
diff --git a/mdadm.h b/mdadm.h
index 3e47fea0bfa71bd6591590178dfa92f2c4a1d1de..3d31576a8eb5147523283be2b0e400f5526f3d6c 100644 (file)
--- a/mdadm.h
+++ b/mdadm.h
@@ -149,6 +149,7 @@ struct mdinfo {
        int                     reshape_active;
        unsigned long long      reshape_progress;
        unsigned long long      resync_start;
+       unsigned long           safe_mode_delay; /* ms delay to mark clean */
        int                     new_level, delta_disks, new_layout, new_chunk;
        int                     errors;
        int                     cache_size; /* size of raid456 stripe cache*/
@@ -805,6 +806,18 @@ static inline int ROUND_UP(int a, int base)
        return ((a+base-1)/base)*base;
 }
 
+static inline int is_subarray(char *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)
 #define        LEVEL_LINEAR            (-1)
 #define        LEVEL_FAULTY            (-5)