summaryrefslogtreecommitdiffstats
path: root/mdadm.h
diff options
context:
space:
mode:
authorNeilBrown <neilb@suse.de>2009-03-09 11:16:53 +1100
committerNeilBrown <neilb@suse.de>2009-03-09 11:16:53 +1100
commitb640a252ee4d0c7be9ab31d9300aec00571b6238 (patch)
tree12ca36b06babede8272f5e4eeab26e74e974e0dc /mdadm.h
parente8e1c176d86433b6d5ebab246257e6f506402fa4 (diff)
downloadmdadm-b640a252ee4d0c7be9ab31d9300aec00571b6238.tar.gz
mdadm-b640a252ee4d0c7be9ab31d9300aec00571b6238.tar.xz
mdadm-b640a252ee4d0c7be9ab31d9300aec00571b6238.zip
Support new raid6 layouts needed for DDF
DDF raid6 layouts are subtly different from the standard 'md' layouts. From 2.6.30 the kernel knows about these. Teach mdadm about them, and also allow 'ddf' to set an appropriate default. Signed-off-by: NeilBrown <neilb@suse.de>
Diffstat (limited to 'mdadm.h')
-rw-r--r--mdadm.h40
1 files changed, 38 insertions, 2 deletions
diff --git a/mdadm.h b/mdadm.h
index f8f3685..f580e3e 100644
--- a/mdadm.h
+++ b/mdadm.h
@@ -394,7 +394,7 @@ extern int restore_stripes(int *dest, unsigned long long *offsets,
extern char *map_num(mapping_t *map, int num);
extern int map_name(mapping_t *map, char *name);
-extern mapping_t r5layout[], pers[], modes[], faultylayout[];
+extern mapping_t r5layout[], r6layout[], pers[], modes[], faultylayout[];
extern char *map_dev(int major, int minor, int create);
@@ -937,8 +937,44 @@ static inline int xasprintf(char **strp, const char *fmt, ...) {
#define makedev(M,m) (((M)<<8) | (m))
#endif
-/* for raid5 */
+/* for raid4/5/6 */
#define ALGORITHM_LEFT_ASYMMETRIC 0
#define ALGORITHM_RIGHT_ASYMMETRIC 1
#define ALGORITHM_LEFT_SYMMETRIC 2
#define ALGORITHM_RIGHT_SYMMETRIC 3
+
+/* Define non-rotating (raid4) algorithms. These allow
+ * conversion of raid4 to raid5.
+ */
+#define ALGORITHM_PARITY_0 4 /* P or P,Q are initial devices */
+#define ALGORITHM_PARITY_N 5 /* P or P,Q are final devices. */
+
+/* DDF RAID6 layouts differ from md/raid6 layouts in two ways.
+ * Firstly, the exact positioning of the parity block is slightly
+ * different between the 'LEFT_*' modes of md and the "_N_*" modes
+ * of DDF.
+ * Secondly, or order of datablocks over which the Q syndrome is computed
+ * is different.
+ * Consequently we have different layouts for DDF/raid6 than md/raid6.
+ * These layouts are from the DDFv1.2 spec.
+ * Interestingly DDFv1.2-Errata-A does not specify N_CONTINUE but
+ * leaves RLQ=3 as 'Vendor Specific'
+ */
+
+#define ALGORITHM_ROTATING_ZERO_RESTART 8 /* DDF PRL=6 RLQ=1 */
+#define ALGORITHM_ROTATING_N_RESTART 9 /* DDF PRL=6 RLQ=2 */
+#define ALGORITHM_ROTATING_N_CONTINUE 10 /*DDF PRL=6 RLQ=3 */
+
+
+/* For every RAID5 algorithm we define a RAID6 algorithm
+ * with exactly the same layout for data and parity, and
+ * with the Q block always on the last device (N-1).
+ * This allows trivial conversion from RAID5 to RAID6
+ */
+#define ALGORITHM_LEFT_ASYMMETRIC_6 16
+#define ALGORITHM_RIGHT_ASYMMETRIC_6 17
+#define ALGORITHM_LEFT_SYMMETRIC_6 18
+#define ALGORITHM_RIGHT_SYMMETRIC_6 19
+#define ALGORITHM_PARITY_0_6 20
+#define ALGORITHM_PARITY_N_6 ALGORITHM_PARITY_N
+