aboutsummaryrefslogtreecommitdiffstats
path: root/include/uapi/linux/raid/md_p.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/uapi/linux/raid/md_p.h')
-rw-r--r--include/uapi/linux/raid/md_p.h73
1 files changed, 72 insertions, 1 deletions
diff --git a/include/uapi/linux/raid/md_p.h b/include/uapi/linux/raid/md_p.h
index 2ae6131e69a5..c3e654c6d518 100644
--- a/include/uapi/linux/raid/md_p.h
+++ b/include/uapi/linux/raid/md_p.h
@@ -89,6 +89,12 @@
89 * read requests will only be sent here in 89 * read requests will only be sent here in
90 * dire need 90 * dire need
91 */ 91 */
92#define MD_DISK_JOURNAL 18 /* disk is used as the write journal in RAID-5/6 */
93
94#define MD_DISK_ROLE_SPARE 0xffff
95#define MD_DISK_ROLE_FAULTY 0xfffe
96#define MD_DISK_ROLE_JOURNAL 0xfffd
97#define MD_DISK_ROLE_MAX 0xff00 /* max value of regular disk role */
92 98
93typedef struct mdp_device_descriptor_s { 99typedef struct mdp_device_descriptor_s {
94 __u32 number; /* 0 Device number in the entire set */ 100 __u32 number; /* 0 Device number in the entire set */
@@ -252,7 +258,10 @@ struct mdp_superblock_1 {
252 __le64 data_offset; /* sector start of data, often 0 */ 258 __le64 data_offset; /* sector start of data, often 0 */
253 __le64 data_size; /* sectors in this device that can be used for data */ 259 __le64 data_size; /* sectors in this device that can be used for data */
254 __le64 super_offset; /* sector start of this superblock */ 260 __le64 super_offset; /* sector start of this superblock */
255 __le64 recovery_offset;/* sectors before this offset (from data_offset) have been recovered */ 261 union {
262 __le64 recovery_offset;/* sectors before this offset (from data_offset) have been recovered */
263 __le64 journal_tail;/* journal tail of journal device (from data_offset) */
264 };
256 __le32 dev_number; /* permanent identifier of this device - not role in raid */ 265 __le32 dev_number; /* permanent identifier of this device - not role in raid */
257 __le32 cnt_corrected_read; /* number of read errors that were corrected by re-writing */ 266 __le32 cnt_corrected_read; /* number of read errors that were corrected by re-writing */
258 __u8 device_uuid[16]; /* user-space setable, ignored by kernel */ 267 __u8 device_uuid[16]; /* user-space setable, ignored by kernel */
@@ -302,6 +311,8 @@ struct mdp_superblock_1 {
302#define MD_FEATURE_RECOVERY_BITMAP 128 /* recovery that is happening 311#define MD_FEATURE_RECOVERY_BITMAP 128 /* recovery that is happening
303 * is guided by bitmap. 312 * is guided by bitmap.
304 */ 313 */
314#define MD_FEATURE_CLUSTERED 256 /* clustered MD */
315#define MD_FEATURE_JOURNAL 512 /* support write cache */
305#define MD_FEATURE_ALL (MD_FEATURE_BITMAP_OFFSET \ 316#define MD_FEATURE_ALL (MD_FEATURE_BITMAP_OFFSET \
306 |MD_FEATURE_RECOVERY_OFFSET \ 317 |MD_FEATURE_RECOVERY_OFFSET \
307 |MD_FEATURE_RESHAPE_ACTIVE \ 318 |MD_FEATURE_RESHAPE_ACTIVE \
@@ -310,6 +321,66 @@ struct mdp_superblock_1 {
310 |MD_FEATURE_RESHAPE_BACKWARDS \ 321 |MD_FEATURE_RESHAPE_BACKWARDS \
311 |MD_FEATURE_NEW_OFFSET \ 322 |MD_FEATURE_NEW_OFFSET \
312 |MD_FEATURE_RECOVERY_BITMAP \ 323 |MD_FEATURE_RECOVERY_BITMAP \
324 |MD_FEATURE_CLUSTERED \
325 |MD_FEATURE_JOURNAL \
313 ) 326 )
314 327
328struct r5l_payload_header {
329 __le16 type;
330 __le16 flags;
331} __attribute__ ((__packed__));
332
333enum r5l_payload_type {
334 R5LOG_PAYLOAD_DATA = 0,
335 R5LOG_PAYLOAD_PARITY = 1,
336 R5LOG_PAYLOAD_FLUSH = 2,
337};
338
339struct r5l_payload_data_parity {
340 struct r5l_payload_header header;
341 __le32 size; /* sector. data/parity size. each 4k
342 * has a checksum */
343 __le64 location; /* sector. For data, it's raid sector. For
344 * parity, it's stripe sector */
345 __le32 checksum[];
346} __attribute__ ((__packed__));
347
348enum r5l_payload_data_parity_flag {
349 R5LOG_PAYLOAD_FLAG_DISCARD = 1, /* payload is discard */
350 /*
351 * RESHAPED/RESHAPING is only set when there is reshape activity. Note,
352 * both data/parity of a stripe should have the same flag set
353 *
354 * RESHAPED: reshape is running, and this stripe finished reshape
355 * RESHAPING: reshape is running, and this stripe isn't reshaped
356 */
357 R5LOG_PAYLOAD_FLAG_RESHAPED = 2,
358 R5LOG_PAYLOAD_FLAG_RESHAPING = 3,
359};
360
361struct r5l_payload_flush {
362 struct r5l_payload_header header;
363 __le32 size; /* flush_stripes size, bytes */
364 __le64 flush_stripes[];
365} __attribute__ ((__packed__));
366
367enum r5l_payload_flush_flag {
368 R5LOG_PAYLOAD_FLAG_FLUSH_STRIPE = 1, /* data represents whole stripe */
369};
370
371struct r5l_meta_block {
372 __le32 magic;
373 __le32 checksum;
374 __u8 version;
375 __u8 __zero_pading_1;
376 __le16 __zero_pading_2;
377 __le32 meta_size; /* whole size of the block */
378
379 __le64 seq;
380 __le64 position; /* sector, start from rdev->data_offset, current position */
381 struct r5l_payload_header payloads[];
382} __attribute__ ((__packed__));
383
384#define R5LOG_VERSION 0x1
385#define R5LOG_MAGIC 0x6433c509
315#endif 386#endif