]> git.ipfire.org Git - thirdparty/mdadm.git/blobdiff - mdadm.h
Provide a mdstat_ent to subarray helper
[thirdparty/mdadm.git] / mdadm.h
diff --git a/mdadm.h b/mdadm.h
index 83152f7df87586fe3f75a01db47a4fcfe2508fe0..a44bb2a98a21cef296d49e074f006c13d4a9d456 100644 (file)
--- a/mdadm.h
+++ b/mdadm.h
@@ -608,6 +608,7 @@ extern struct superswitch {
        int (*load_container)(struct supertype *st, int fd, char *devname);
        struct supertype * (*match_metadata_desc)(char *arg);
        __u64 (*avail_size)(struct supertype *st, __u64 size);
+       unsigned long long (*min_acceptable_spare_size)(struct supertype *st);
        int (*add_internal_bitmap)(struct supertype *st, int *chunkp,
                                   int delay, int write_behind,
                                   unsigned long long size, int may_change, int major);
@@ -681,6 +682,21 @@ extern struct superswitch {
         */
        struct mdinfo *(*activate_spare)(struct active_array *a,
                                         struct metadata_update **updates);
+       /*
+        * Return statically allocated string that represents metadata specific
+        * controller domain of the disk. The domain is used in disk domain
+        * matching functions. Disks belong to the same domain if the they have
+        * the same domain from mdadm.conf and belong the same metadata domain.
+        * Returning NULL or not providing this handler means that metadata
+        * does not distinguish the differences between disks that belong to
+        * different controllers. They are in the domain specified by
+        * configuration file (mdadm.conf).
+        * In case when the metadata has the notion of domains based on disk
+        * it shall return NULL for disks that do not belong to the controller
+        * the supported domains. Such disks will form another domain and won't
+        * be mixed with supported ones.
+        */
+       const char *(*get_disk_controller_domain)(const char *path);
 
        int swapuuid; /* true if uuid is bigending rather than hostendian */
        int external;
@@ -767,7 +783,7 @@ struct dev_policy {
                         * name and metadata can be compared by address equality.
                         */
        const char *metadata;
-       char *value;
+       const char *value;
 };
 
 extern char pol_act[], pol_domain[], pol_metadata[], pol_auto[];
@@ -833,7 +849,7 @@ extern int disk_action_allows(struct mdinfo *disk, const char *metadata,
 
 struct domainlist {
        struct domainlist *next;
-       char *dom;
+       const char *dom;
 };
 
 extern int domain_test(struct domainlist *dom, struct dev_policy *pol,
@@ -1094,6 +1110,11 @@ static inline int is_subarray(char *vers)
        return (*vers == '/' || *vers == '-');
 }
 
+static inline char *to_subarray(struct mdstat_ent *ent, char *container)
+{
+       return &ent->metadata_version[10+strlen(container)+1];
+}
+
 #ifdef DEBUG
 #define dprintf(fmt, arg...) \
        fprintf(stderr, fmt, ##arg)