]> git.ipfire.org Git - thirdparty/mdadm.git/blobdiff - mdadm.h
Create: warn when a metadata format's platform components are missing
[thirdparty/mdadm.git] / mdadm.h
diff --git a/mdadm.h b/mdadm.h
index e75648bae10f6f2a2db466656ac287f77bbc3382..7c8c2f127534e3230a65c39666d89f245c502549 100644 (file)
--- a/mdadm.h
+++ b/mdadm.h
@@ -443,7 +443,7 @@ extern struct superswitch {
        void (*export_detail_super)(struct supertype *st);
 
        /* Optional: platform hardware / firmware details */
-       int (*detail_platform)(int verbose);
+       int (*detail_platform)(int verbose, int enumerate_only);
 
        /* Used:
         *   to get uuid to storing in bitmap metadata
@@ -545,6 +545,8 @@ extern struct superswitch {
                                 int verbose);
 
        struct mdinfo *(*container_content)(struct supertype *st);
+       /* Allow a metadata handler to override mdadm's default layouts */
+       int (*default_layout)(int level); /* optional */
 
 /* for mdmon */
        int (*open_new)(struct supertype *c, struct active_array *a,
@@ -880,6 +882,17 @@ static inline int is_subarray(char *vers)
 #define dprintf(fmt, arg...) \
         ({ if (0) fprintf(stderr, fmt, ##arg); 0; })
 #endif
+#include <assert.h>
+#include <stdarg.h>
+static inline int xasprintf(char **strp, const char *fmt, ...) {
+       va_list ap;
+       int ret;
+       va_start(ap, fmt);
+       ret = asprintf(strp, fmt, ap);
+       va_end(ap);
+       assert(ret >= 0);
+       return ret;
+}
 
 #define        LEVEL_MULTIPATH         (-4)
 #define        LEVEL_LINEAR            (-1)