blob: b24e5d675346859a545eaed69e6deadbaa3f7188 [file] [log] [blame]
Ben Cheng655a7c02013-10-16 16:09:24 -07001/****************************************************************************
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#include <linux/types.h>
Christopher Ferris38062f92014-07-09 15:33:25 -070022#include <asm/byteorder.h>
Ben Cheng655a7c02013-10-16 16:09:24 -070023/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferris38062f92014-07-09 15:33:25 -070024#define MD_RESERVED_BYTES (64 * 1024)
Ben Cheng655a7c02013-10-16 16:09:24 -070025#define MD_RESERVED_SECTORS (MD_RESERVED_BYTES / 512)
26#define MD_NEW_SIZE_SECTORS(x) ((x & ~(MD_RESERVED_SECTORS - 1)) - MD_RESERVED_SECTORS)
27#define MD_SB_BYTES 4096
Ben Cheng655a7c02013-10-16 16:09:24 -070028/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferris38062f92014-07-09 15:33:25 -070029#define MD_SB_WORDS (MD_SB_BYTES / 4)
Ben Cheng655a7c02013-10-16 16:09:24 -070030#define MD_SB_SECTORS (MD_SB_BYTES / 512)
31#define MD_SB_GENERIC_OFFSET 0
32#define MD_SB_PERSONALITY_OFFSET 64
Ben Cheng655a7c02013-10-16 16:09:24 -070033/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferris38062f92014-07-09 15:33:25 -070034#define MD_SB_DISKS_OFFSET 128
Ben Cheng655a7c02013-10-16 16:09:24 -070035#define MD_SB_DESCRIPTOR_OFFSET 992
36#define MD_SB_GENERIC_CONSTANT_WORDS 32
37#define MD_SB_GENERIC_STATE_WORDS 32
Ben Cheng655a7c02013-10-16 16:09:24 -070038/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferris38062f92014-07-09 15:33:25 -070039#define MD_SB_GENERIC_WORDS (MD_SB_GENERIC_CONSTANT_WORDS + MD_SB_GENERIC_STATE_WORDS)
Ben Cheng655a7c02013-10-16 16:09:24 -070040#define MD_SB_PERSONALITY_WORDS 64
41#define MD_SB_DESCRIPTOR_WORDS 32
42#define MD_SB_DISKS 27
Ben Cheng655a7c02013-10-16 16:09:24 -070043/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Tao Baod7db5942015-01-28 10:07:51 -080044#define MD_SB_DISKS_WORDS (MD_SB_DISKS * MD_SB_DESCRIPTOR_WORDS)
Ben Cheng655a7c02013-10-16 16:09:24 -070045#define MD_SB_RESERVED_WORDS (1024 - MD_SB_GENERIC_WORDS - MD_SB_PERSONALITY_WORDS - MD_SB_DISKS_WORDS - MD_SB_DESCRIPTOR_WORDS)
46#define MD_SB_EQUAL_WORDS (MD_SB_GENERIC_WORDS + MD_SB_PERSONALITY_WORDS + MD_SB_DISKS_WORDS)
47#define MD_DISK_FAULTY 0
Ben Cheng655a7c02013-10-16 16:09:24 -070048/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferris38062f92014-07-09 15:33:25 -070049#define MD_DISK_ACTIVE 1
Ben Cheng655a7c02013-10-16 16:09:24 -070050#define MD_DISK_SYNC 2
51#define MD_DISK_REMOVED 3
Christopher Ferris05d08e92016-02-04 13:16:38 -080052#define MD_DISK_CLUSTER_ADD 4
Ben Cheng655a7c02013-10-16 16:09:24 -070053/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferris05d08e92016-02-04 13:16:38 -080054#define MD_DISK_CANDIDATE 5
55#define MD_DISK_WRITEMOSTLY 9
56#define MD_DISK_JOURNAL 18
57#define MD_DISK_ROLE_SPARE 0xffff
58/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
59#define MD_DISK_ROLE_FAULTY 0xfffe
60#define MD_DISK_ROLE_JOURNAL 0xfffd
61#define MD_DISK_ROLE_MAX 0xff00
Christopher Ferris38062f92014-07-09 15:33:25 -070062typedef struct mdp_device_descriptor_s {
Christopher Ferris05d08e92016-02-04 13:16:38 -080063/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Tao Baod7db5942015-01-28 10:07:51 -080064 __u32 number;
65 __u32 major;
66 __u32 minor;
Tao Baod7db5942015-01-28 10:07:51 -080067 __u32 raid_disk;
Christopher Ferris05d08e92016-02-04 13:16:38 -080068/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Tao Baod7db5942015-01-28 10:07:51 -080069 __u32 state;
70 __u32 reserved[MD_SB_DESCRIPTOR_WORDS - 5];
Ben Cheng655a7c02013-10-16 16:09:24 -070071} mdp_disk_t;
Christopher Ferris38062f92014-07-09 15:33:25 -070072#define MD_SB_MAGIC 0xa92b4efc
Christopher Ferris05d08e92016-02-04 13:16:38 -080073/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Ben Cheng655a7c02013-10-16 16:09:24 -070074#define MD_SB_CLEAN 0
75#define MD_SB_ERRORS 1
Christopher Ferris05d08e92016-02-04 13:16:38 -080076#define MD_SB_CLUSTERED 5
Ben Cheng655a7c02013-10-16 16:09:24 -070077#define MD_SB_BITMAP_PRESENT 8
Ben Cheng655a7c02013-10-16 16:09:24 -070078/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferris38062f92014-07-09 15:33:25 -070079typedef struct mdp_superblock_s {
Tao Baod7db5942015-01-28 10:07:51 -080080 __u32 md_magic;
81 __u32 major_version;
82 __u32 minor_version;
Ben Cheng655a7c02013-10-16 16:09:24 -070083/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Tao Baod7db5942015-01-28 10:07:51 -080084 __u32 patch_version;
85 __u32 gvalid_words;
86 __u32 set_uuid0;
87 __u32 ctime;
Ben Cheng655a7c02013-10-16 16:09:24 -070088/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Tao Baod7db5942015-01-28 10:07:51 -080089 __u32 level;
90 __u32 size;
91 __u32 nr_disks;
92 __u32 raid_disks;
Ben Cheng655a7c02013-10-16 16:09:24 -070093/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Tao Baod7db5942015-01-28 10:07:51 -080094 __u32 md_minor;
95 __u32 not_persistent;
96 __u32 set_uuid1;
97 __u32 set_uuid2;
Ben Cheng655a7c02013-10-16 16:09:24 -070098/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Tao Baod7db5942015-01-28 10:07:51 -080099 __u32 set_uuid3;
100 __u32 gstate_creserved[MD_SB_GENERIC_CONSTANT_WORDS - 16];
101 __u32 utime;
102 __u32 state;
Ben Cheng655a7c02013-10-16 16:09:24 -0700103/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Tao Baod7db5942015-01-28 10:07:51 -0800104 __u32 active_disks;
105 __u32 working_disks;
106 __u32 failed_disks;
107 __u32 spare_disks;
Ben Cheng655a7c02013-10-16 16:09:24 -0700108/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Tao Baod7db5942015-01-28 10:07:51 -0800109 __u32 sb_csum;
Elliott Hughes8cb52b02013-11-21 13:43:23 -0800110#if defined(__BYTE_ORDER) ? __BYTE_ORDER == __BIG_ENDIAN : defined(__BIG_ENDIAN)
Tao Baod7db5942015-01-28 10:07:51 -0800111 __u32 events_hi;
112 __u32 events_lo;
Ben Cheng655a7c02013-10-16 16:09:24 -0700113/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Tao Baod7db5942015-01-28 10:07:51 -0800114 __u32 cp_events_hi;
115 __u32 cp_events_lo;
116#elif defined(__BYTE_ORDER)?__BYTE_ORDER==__LITTLE_ENDIAN:defined(__LITTLE_ENDIAN)
117 __u32 events_lo;
Ben Cheng655a7c02013-10-16 16:09:24 -0700118/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Tao Baod7db5942015-01-28 10:07:51 -0800119 __u32 events_hi;
120 __u32 cp_events_lo;
121 __u32 cp_events_hi;
Ben Cheng655a7c02013-10-16 16:09:24 -0700122#else
Ben Cheng655a7c02013-10-16 16:09:24 -0700123/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferris38062f92014-07-09 15:33:25 -0700124#error unspecified endianness
Ben Cheng655a7c02013-10-16 16:09:24 -0700125#endif
Tao Baod7db5942015-01-28 10:07:51 -0800126 __u32 recovery_cp;
127 __u64 reshape_position;
Ben Cheng655a7c02013-10-16 16:09:24 -0700128/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Tao Baod7db5942015-01-28 10:07:51 -0800129 __u32 new_level;
130 __u32 delta_disks;
131 __u32 new_layout;
132 __u32 new_chunk;
Ben Cheng655a7c02013-10-16 16:09:24 -0700133/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Tao Baod7db5942015-01-28 10:07:51 -0800134 __u32 gstate_sreserved[MD_SB_GENERIC_STATE_WORDS - 18];
135 __u32 layout;
136 __u32 chunk_size;
137 __u32 root_pv;
Ben Cheng655a7c02013-10-16 16:09:24 -0700138/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Tao Baod7db5942015-01-28 10:07:51 -0800139 __u32 root_block;
140 __u32 pstate_reserved[MD_SB_PERSONALITY_WORDS - 4];
141 mdp_disk_t disks[MD_SB_DISKS];
142 __u32 reserved[MD_SB_RESERVED_WORDS];
Ben Cheng655a7c02013-10-16 16:09:24 -0700143/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Tao Baod7db5942015-01-28 10:07:51 -0800144 mdp_disk_t this_disk;
Ben Cheng655a7c02013-10-16 16:09:24 -0700145} mdp_super_t;
Tao Baod7db5942015-01-28 10:07:51 -0800146#define MD_SUPERBLOCK_1_TIME_SEC_MASK ((1ULL << 40) - 1)
Ben Cheng655a7c02013-10-16 16:09:24 -0700147struct mdp_superblock_1 {
Ben Cheng655a7c02013-10-16 16:09:24 -0700148/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Tao Baod7db5942015-01-28 10:07:51 -0800149 __le32 magic;
150 __le32 major_version;
151 __le32 feature_map;
152 __le32 pad0;
Ben Cheng655a7c02013-10-16 16:09:24 -0700153/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Tao Baod7db5942015-01-28 10:07:51 -0800154 __u8 set_uuid[16];
155 char set_name[32];
156 __le64 ctime;
157 __le32 level;
Ben Cheng655a7c02013-10-16 16:09:24 -0700158/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Tao Baod7db5942015-01-28 10:07:51 -0800159 __le32 layout;
160 __le64 size;
161 __le32 chunksize;
162 __le32 raid_disks;
Ben Cheng655a7c02013-10-16 16:09:24 -0700163/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Tao Baod7db5942015-01-28 10:07:51 -0800164 __le32 bitmap_offset;
165 __le32 new_level;
166 __le64 reshape_position;
167 __le32 delta_disks;
Ben Cheng655a7c02013-10-16 16:09:24 -0700168/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Tao Baod7db5942015-01-28 10:07:51 -0800169 __le32 new_layout;
170 __le32 new_chunk;
171 __le32 new_offset;
172 __le64 data_offset;
Ben Cheng655a7c02013-10-16 16:09:24 -0700173/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Tao Baod7db5942015-01-28 10:07:51 -0800174 __le64 data_size;
175 __le64 super_offset;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800176 union {
177 __le64 recovery_offset;
Ben Cheng655a7c02013-10-16 16:09:24 -0700178/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferris05d08e92016-02-04 13:16:38 -0800179 __le64 journal_tail;
180 };
181 __le32 dev_number;
Tao Baod7db5942015-01-28 10:07:51 -0800182 __le32 cnt_corrected_read;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800183/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Tao Baod7db5942015-01-28 10:07:51 -0800184 __u8 device_uuid[16];
185 __u8 devflags;
Ben Cheng655a7c02013-10-16 16:09:24 -0700186#define WriteMostly1 1
Tao Baod7db5942015-01-28 10:07:51 -0800187 __u8 bblog_shift;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800188/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Tao Baod7db5942015-01-28 10:07:51 -0800189 __le16 bblog_size;
190 __le32 bblog_offset;
191 __le64 utime;
Tao Baod7db5942015-01-28 10:07:51 -0800192 __le64 events;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800193/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Tao Baod7db5942015-01-28 10:07:51 -0800194 __le64 resync_offset;
195 __le32 sb_csum;
196 __le32 max_dev;
Tao Baod7db5942015-01-28 10:07:51 -0800197 __u8 pad3[64 - 32];
Christopher Ferris05d08e92016-02-04 13:16:38 -0800198/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Tao Baod7db5942015-01-28 10:07:51 -0800199 __le16 dev_roles[0];
Ben Cheng655a7c02013-10-16 16:09:24 -0700200};
201#define MD_FEATURE_BITMAP_OFFSET 1
Christopher Ferris38062f92014-07-09 15:33:25 -0700202#define MD_FEATURE_RECOVERY_OFFSET 2
Christopher Ferris05d08e92016-02-04 13:16:38 -0800203/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Ben Cheng655a7c02013-10-16 16:09:24 -0700204#define MD_FEATURE_RESHAPE_ACTIVE 4
205#define MD_FEATURE_BAD_BLOCKS 8
206#define MD_FEATURE_REPLACEMENT 16
Christopher Ferris38062f92014-07-09 15:33:25 -0700207#define MD_FEATURE_RESHAPE_BACKWARDS 32
Christopher Ferris05d08e92016-02-04 13:16:38 -0800208/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Ben Cheng655a7c02013-10-16 16:09:24 -0700209#define MD_FEATURE_NEW_OFFSET 64
Christopher Ferris38062f92014-07-09 15:33:25 -0700210#define MD_FEATURE_RECOVERY_BITMAP 128
Christopher Ferris05d08e92016-02-04 13:16:38 -0800211#define MD_FEATURE_CLUSTERED 256
212#define MD_FEATURE_JOURNAL 512
Christopher Ferris38062f92014-07-09 15:33:25 -0700213/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferris05d08e92016-02-04 13:16:38 -0800214#define MD_FEATURE_ALL (MD_FEATURE_BITMAP_OFFSET | MD_FEATURE_RECOVERY_OFFSET | MD_FEATURE_RESHAPE_ACTIVE | MD_FEATURE_BAD_BLOCKS | MD_FEATURE_REPLACEMENT | MD_FEATURE_RESHAPE_BACKWARDS | MD_FEATURE_NEW_OFFSET | MD_FEATURE_RECOVERY_BITMAP | MD_FEATURE_CLUSTERED | MD_FEATURE_JOURNAL)
215struct r5l_payload_header {
216 __le16 type;
217 __le16 flags;
218/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
219} __attribute__((__packed__));
220enum r5l_payload_type {
221 R5LOG_PAYLOAD_DATA = 0,
222 R5LOG_PAYLOAD_PARITY = 1,
223/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
224 R5LOG_PAYLOAD_FLUSH = 2,
225};
226struct r5l_payload_data_parity {
227 struct r5l_payload_header header;
228/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
229 __le32 size;
230 __le64 location;
231 __le32 checksum[];
232} __attribute__((__packed__));
233/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
234enum r5l_payload_data_parity_flag {
235 R5LOG_PAYLOAD_FLAG_DISCARD = 1,
236 R5LOG_PAYLOAD_FLAG_RESHAPED = 2,
237 R5LOG_PAYLOAD_FLAG_RESHAPING = 3,
238/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
239};
240struct r5l_payload_flush {
241 struct r5l_payload_header header;
242 __le32 size;
243/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
244 __le64 flush_stripes[];
245} __attribute__((__packed__));
246enum r5l_payload_flush_flag {
247 R5LOG_PAYLOAD_FLAG_FLUSH_STRIPE = 1,
248/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
249};
250struct r5l_meta_block {
251 __le32 magic;
252 __le32 checksum;
253/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
254 __u8 version;
255 __u8 __zero_pading_1;
256 __le16 __zero_pading_2;
257 __le32 meta_size;
258/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
259 __le64 seq;
260 __le64 position;
261 struct r5l_payload_header payloads[];
262} __attribute__((__packed__));
263/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
264#define R5LOG_VERSION 0x1
265#define R5LOG_MAGIC 0x6433c509
Ben Cheng655a7c02013-10-16 16:09:24 -0700266#endif