]> git.ipfire.org Git - thirdparty/mdadm.git/blobdiff - md_p.h
--update: add 'bbl' and 'no-bbl' to the list of known updates.
[thirdparty/mdadm.git] / md_p.h
diff --git a/md_p.h b/md_p.h
index d6bb37a810b3f41f4e1d48acc6dae837e1be76ed..c4846babcff5ed06f45c938b715acd7f8861d8a1 100644 (file)
--- a/md_p.h
+++ b/md_p.h
@@ -1,15 +1,15 @@
 /*
    md_p.h : physical layout of Linux RAID devices
           Copyright (C) 1996-98 Ingo Molnar, Gadi Oxman
-         
+
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation; either version 2, or (at your option)
    any later version.
-   
+
    You should have received a copy of the GNU General Public License
    (for example /usr/src/linux/COPYING); if not, write to the Free
-   Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.  
+   Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 */
 
 #ifndef _MD_P_H
  * Device "operational" state bits
  */
 #define MD_DISK_FAULTY         0 /* disk is faulty / operational */
-#define MD_DISK_ACTIVE         1 /* disk is running or spare disk */
+#define MD_DISK_ACTIVE         1 /* disk is running but may not be in sync */
 #define MD_DISK_SYNC           2 /* disk is in sync with the raid set */
 #define MD_DISK_REMOVED                3 /* disk is in sync with the raid set */
 
+#define        MD_DISK_WRITEMOSTLY     9 /* disk is "write-mostly" is RAID1 config.
+                                  * read requests will only be sent here in
+                                  * dire need
+                                  */
+
+#define MD_DISK_REPLACEMENT    17
+
 typedef struct mdp_device_descriptor_s {
        __u32 number;           /* 0 Device number in the entire set          */
        __u32 major;            /* 1 Device major number                      */
@@ -95,12 +102,17 @@ typedef struct mdp_device_descriptor_s {
  */
 #define MD_SB_CLEAN            0
 #define MD_SB_ERRORS           1
+#define MD_SB_BBM_ERRORS       2
+#define MD_SB_BLOCK_CONTAINER_RESHAPE 3 /* block container wide reshapes */
+#define MD_SB_BLOCK_VOLUME     4 /* block activation of array, other arrays
+                                  * in container can be activated */
+#define        MD_SB_BITMAP_PRESENT    8 /* bitmap may be present nearby */
 
 typedef struct mdp_superblock_s {
        /*
         * Constant generic information
         */
-       __u32 md_magic;         /*  0 MD identifier                           */
+       __u32 md_magic;         /*  0 MD identifier                           */
        __u32 major_version;    /*  1 major version to which the set conforms */
        __u32 minor_version;    /*  2 minor version ...                       */
        __u32 patch_version;    /*  3 patchlevel version ...                  */
@@ -128,14 +140,25 @@ typedef struct mdp_superblock_s {
        __u32 failed_disks;     /*  4 Number of failed disks                  */
        __u32 spare_disks;      /*  5 Number of spare disks                   */
        __u32 sb_csum;          /*  6 checksum of the whole superblock        */
-#ifdef __BIG_ENDIAN
+#if  __BYTE_ORDER ==  __BIG_ENDIAN
        __u32 events_hi;        /*  7 high-order of superblock update count   */
        __u32 events_lo;        /*  8 low-order of superblock update count    */
+       __u32 cp_events_hi;     /*  9 high-order of checkpoint update count   */
+       __u32 cp_events_lo;     /* 10 low-order of checkpoint update count    */
 #else
        __u32 events_lo;        /*  7 low-order of superblock update count    */
        __u32 events_hi;        /*  8 high-order of superblock update count   */
+       __u32 cp_events_lo;     /*  9 low-order of checkpoint update count    */
+       __u32 cp_events_hi;     /* 10 high-order of checkpoint update count   */
 #endif
-       __u32 gstate_sreserved[MD_SB_GENERIC_STATE_WORDS - 9];
+       __u32 recovery_cp;      /* 11 recovery checkpoint sector count        */
+       /* There are only valid for minor_version > 90 */
+       __u64 reshape_position; /* 12,13 next address in array-space for reshape */
+       __u32 new_level;        /* 14 new level we are reshaping to           */
+       __u32 delta_disks;      /* 15 change in number of raid_disks          */
+       __u32 new_layout;       /* 16 new layout                              */
+       __u32 new_chunk;        /* 17 new chunk size (bytes)                  */
+       __u32 gstate_sreserved[MD_SB_GENERIC_STATE_WORDS - 18];
 
        /*
         * Personality information
@@ -163,10 +186,13 @@ typedef struct mdp_superblock_s {
 
 } mdp_super_t;
 
+#ifdef __TINYC__
+typedef unsigned long long __u64;
+#endif
+
 static inline __u64 md_event(mdp_super_t *sb) {
        __u64 ev = sb->events_hi;
        return (ev<<32)| sb->events_lo;
 }
 
-#endif 
-
+#endif