]> git.ipfire.org Git - thirdparty/mdadm.git/blobdiff - md_p.h
util: Introduce md_get_array_info()
[thirdparty/mdadm.git] / md_p.h
diff --git a/md_p.h b/md_p.h
index 0d691fbc987dc3bd9a0845a8c63d7af40cd925c7..358a28ce3fcff3be791712848c41402d835e79cd 100644 (file)
--- a/md_p.h
+++ b/md_p.h
@@ -89,6 +89,7 @@
                                   * read requests will only be sent here in
                                   * dire need
                                   */
+#define        MD_DISK_FAILFAST        10 /* Fewer retries, more failures */
 
 #define MD_DISK_REPLACEMENT    17
 #define MD_DISK_JOURNAL                18 /* disk is used as the write journal in RAID-5/6 */
@@ -266,4 +267,29 @@ struct r5l_meta_block {
 #define R5LOG_VERSION 0x1
 #define R5LOG_MAGIC 0x6433c509
 
+struct ppl_header_entry {
+       __u64 data_sector;      /* raid sector of the new data */
+       __u32 pp_size;          /* length of partial parity */
+       __u32 data_size;        /* length of data */
+       __u32 parity_disk;      /* member disk containing parity */
+       __u32 checksum;         /* checksum of this entry's partial parity */
+} __attribute__ ((__packed__));
+
+#define PPL_HEADER_SIZE 4096
+#define PPL_HDR_RESERVED 512
+#define PPL_HDR_ENTRY_SPACE \
+       (PPL_HEADER_SIZE - PPL_HDR_RESERVED - 4 * sizeof(__u32) - sizeof(__u64))
+#define PPL_HDR_MAX_ENTRIES \
+       (PPL_HDR_ENTRY_SPACE / sizeof(struct ppl_header_entry))
+
+struct ppl_header {
+       __u8 reserved[PPL_HDR_RESERVED];/* reserved space, fill with 0xff */
+       __u32 signature;                /* signature (family number of volume) */
+       __u32 padding;                  /* zero pad */
+       __u64 generation;               /* generation number of the header */
+       __u32 entries_count;            /* number of entries in entry array */
+       __u32 checksum;                 /* checksum of the header */
+       struct ppl_header_entry entries[PPL_HDR_MAX_ENTRIES];
+} __attribute__ ((__packed__));
+
 #endif