Home | History | Annotate | Download | only in raid
      1 /****************************************************************************
      2  ****************************************************************************
      3  ***
      4  ***   This header was automatically generated from a Linux kernel header
      5  ***   of the same name, to make information necessary for userspace to
      6  ***   call into the kernel available to libc.  It contains only constants,
      7  ***   structures, and macros generated from the original header, and thus,
      8  ***   contains no copyrightable information.
      9  ***
     10  ***   To edit the content of this header, modify the corresponding
     11  ***   source file (e.g. under external/kernel-headers/original/) then
     12  ***   run bionic/libc/kernel/tools/update_all.py
     13  ***
     14  ***   Any manual change here will be lost the next time this script will
     15  ***   be run. You've been warned!
     16  ***
     17  ****************************************************************************
     18  ****************************************************************************/
     19 #ifndef _MD_P_H
     20 #define _MD_P_H
     21 #define MD_RESERVED_BYTES (64 * 1024)
     22 #define MD_RESERVED_SECTORS (MD_RESERVED_BYTES / 512)
     23 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
     24 #define MD_RESERVED_BLOCKS (MD_RESERVED_BYTES / BLOCK_SIZE)
     25 #define MD_NEW_SIZE_SECTORS(x) ((x & ~(MD_RESERVED_SECTORS - 1)) - MD_RESERVED_SECTORS)
     26 #define MD_NEW_SIZE_BLOCKS(x) ((x & ~(MD_RESERVED_BLOCKS - 1)) - MD_RESERVED_BLOCKS)
     27 #define MD_SB_BYTES 4096
     28 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
     29 #define MD_SB_WORDS (MD_SB_BYTES / 4)
     30 #define MD_SB_BLOCKS (MD_SB_BYTES / BLOCK_SIZE)
     31 #define MD_SB_SECTORS (MD_SB_BYTES / 512)
     32 #define MD_SB_GENERIC_OFFSET 0
     33 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
     34 #define MD_SB_PERSONALITY_OFFSET 64
     35 #define MD_SB_DISKS_OFFSET 128
     36 #define MD_SB_DESCRIPTOR_OFFSET 992
     37 #define MD_SB_GENERIC_CONSTANT_WORDS 32
     38 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
     39 #define MD_SB_GENERIC_STATE_WORDS 32
     40 #define MD_SB_GENERIC_WORDS (MD_SB_GENERIC_CONSTANT_WORDS + MD_SB_GENERIC_STATE_WORDS)
     41 #define MD_SB_PERSONALITY_WORDS 64
     42 #define MD_SB_DESCRIPTOR_WORDS 32
     43 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
     44 #define MD_SB_DISKS 27
     45 #define MD_SB_DISKS_WORDS (MD_SB_DISKS*MD_SB_DESCRIPTOR_WORDS)
     46 #define MD_SB_RESERVED_WORDS (1024 - MD_SB_GENERIC_WORDS - MD_SB_PERSONALITY_WORDS - MD_SB_DISKS_WORDS - MD_SB_DESCRIPTOR_WORDS)
     47 #define MD_SB_EQUAL_WORDS (MD_SB_GENERIC_WORDS + MD_SB_PERSONALITY_WORDS + MD_SB_DISKS_WORDS)
     48 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
     49 #define MD_DISK_FAULTY 0
     50 #define MD_DISK_ACTIVE 1
     51 #define MD_DISK_SYNC 2
     52 #define MD_DISK_REMOVED 3
     53 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
     54 #define MD_DISK_WRITEMOSTLY 9
     55 typedef struct mdp_device_descriptor_s {
     56  __u32 number;
     57  __u32 major;
     58 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
     59  __u32 minor;
     60  __u32 raid_disk;
     61  __u32 state;
     62  __u32 reserved[MD_SB_DESCRIPTOR_WORDS - 5];
     63 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
     64 } mdp_disk_t;
     65 #define MD_SB_MAGIC 0xa92b4efc
     66 #define MD_SB_CLEAN 0
     67 #define MD_SB_ERRORS 1
     68 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
     69 #define MD_SB_BITMAP_PRESENT 8
     70 typedef struct mdp_superblock_s {
     71  __u32 md_magic;
     72  __u32 major_version;
     73 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
     74  __u32 minor_version;
     75  __u32 patch_version;
     76  __u32 gvalid_words;
     77  __u32 set_uuid0;
     78 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
     79  __u32 ctime;
     80  __u32 level;
     81  __u32 size;
     82  __u32 nr_disks;
     83 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
     84  __u32 raid_disks;
     85  __u32 md_minor;
     86  __u32 not_persistent;
     87  __u32 set_uuid1;
     88 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
     89  __u32 set_uuid2;
     90  __u32 set_uuid3;
     91  __u32 gstate_creserved[MD_SB_GENERIC_CONSTANT_WORDS - 16];
     92  __u32 utime;
     93 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
     94  __u32 state;
     95  __u32 active_disks;
     96  __u32 working_disks;
     97  __u32 failed_disks;
     98 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
     99  __u32 spare_disks;
    100  __u32 sb_csum;
    101 #ifdef __BIG_ENDIAN
    102  __u32 events_hi;
    103 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
    104  __u32 events_lo;
    105  __u32 cp_events_hi;
    106  __u32 cp_events_lo;
    107 #else
    108 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
    109  __u32 events_lo;
    110  __u32 events_hi;
    111  __u32 cp_events_lo;
    112  __u32 cp_events_hi;
    113 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
    114 #endif
    115  __u32 recovery_cp;
    116  __u64 reshape_position;
    117  __u32 new_level;
    118 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
    119  __u32 delta_disks;
    120  __u32 new_layout;
    121  __u32 new_chunk;
    122  __u32 gstate_sreserved[MD_SB_GENERIC_STATE_WORDS - 18];
    123 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
    124  __u32 layout;
    125  __u32 chunk_size;
    126  __u32 root_pv;
    127  __u32 root_block;
    128 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
    129  __u32 pstate_reserved[MD_SB_PERSONALITY_WORDS - 4];
    130  mdp_disk_t disks[MD_SB_DISKS];
    131  __u32 reserved[MD_SB_RESERVED_WORDS];
    132  mdp_disk_t this_disk;
    133 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
    134 } mdp_super_t;
    135 struct mdp_superblock_1 {
    136  __u32 magic;
    137  __u32 major_version;
    138 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
    139  __u32 feature_map;
    140  __u32 pad0;
    141  __u8 set_uuid[16];
    142  char set_name[32];
    143 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
    144  __u64 ctime;
    145  __u32 level;
    146  __u32 layout;
    147  __u64 size;
    148 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
    149  __u32 chunksize;
    150  __u32 raid_disks;
    151  __u32 bitmap_offset;
    152  __u32 new_level;
    153 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
    154  __u64 reshape_position;
    155  __u32 delta_disks;
    156  __u32 new_layout;
    157  __u32 new_chunk;
    158 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
    159  __u8 pad1[128-124];
    160  __u64 data_offset;
    161  __u64 data_size;
    162  __u64 super_offset;
    163 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
    164  __u64 recovery_offset;
    165  __u32 dev_number;
    166  __u32 cnt_corrected_read;
    167  __u8 device_uuid[16];
    168 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
    169  __u8 devflags;
    170 #define WriteMostly1 1
    171  __u8 pad2[64-57];
    172  __u64 utime;
    173 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
    174  __u64 events;
    175  __u64 resync_offset;
    176  __u32 sb_csum;
    177  __u32 max_dev;
    178 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
    179  __u8 pad3[64-32];
    180  __u16 dev_roles[0];
    181 };
    182 #define MD_FEATURE_BITMAP_OFFSET 1
    183 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
    184 #define MD_FEATURE_RECOVERY_OFFSET 2
    185 #define MD_FEATURE_RESHAPE_ACTIVE 4
    186 #define MD_FEATURE_ALL (1|2|4)
    187 #endif
    188 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
    189