aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/raid
diff options
context:
space:
mode:
authorJonathan Herman <hermanjl@cs.unc.edu>2013-01-17 16:15:55 -0500
committerJonathan Herman <hermanjl@cs.unc.edu>2013-01-17 16:15:55 -0500
commit8dea78da5cee153b8af9c07a2745f6c55057fe12 (patch)
treea8f4d49d63b1ecc92f2fddceba0655b2472c5bd9 /include/linux/raid
parent406089d01562f1e2bf9f089fd7637009ebaad589 (diff)
Patched in Tegra support.
Diffstat (limited to 'include/linux/raid')
-rw-r--r--include/linux/raid/md_u.h141
-rw-r--r--include/linux/raid/pq.h24
2 files changed, 143 insertions, 22 deletions
diff --git a/include/linux/raid/md_u.h b/include/linux/raid/md_u.h
index 358c04bfbe2..fb1abb3367e 100644
--- a/include/linux/raid/md_u.h
+++ b/include/linux/raid/md_u.h
@@ -11,10 +11,149 @@
11 (for example /usr/src/linux/COPYING); if not, write to the Free 11 (for example /usr/src/linux/COPYING); if not, write to the Free
12 Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 12 Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
13*/ 13*/
14
14#ifndef _MD_U_H 15#ifndef _MD_U_H
15#define _MD_U_H 16#define _MD_U_H
16 17
17#include <uapi/linux/raid/md_u.h> 18/*
19 * Different major versions are not compatible.
20 * Different minor versions are only downward compatible.
21 * Different patchlevel versions are downward and upward compatible.
22 */
23#define MD_MAJOR_VERSION 0
24#define MD_MINOR_VERSION 90
25/*
26 * MD_PATCHLEVEL_VERSION indicates kernel functionality.
27 * >=1 means different superblock formats are selectable using SET_ARRAY_INFO
28 * and major_version/minor_version accordingly
29 * >=2 means that Internal bitmaps are supported by setting MD_SB_BITMAP_PRESENT
30 * in the super status byte
31 * >=3 means that bitmap superblock version 4 is supported, which uses
32 * little-ending representation rather than host-endian
33 */
34#define MD_PATCHLEVEL_VERSION 3
35
36/* ioctls */
37
38/* status */
39#define RAID_VERSION _IOR (MD_MAJOR, 0x10, mdu_version_t)
40#define GET_ARRAY_INFO _IOR (MD_MAJOR, 0x11, mdu_array_info_t)
41#define GET_DISK_INFO _IOR (MD_MAJOR, 0x12, mdu_disk_info_t)
42#define PRINT_RAID_DEBUG _IO (MD_MAJOR, 0x13)
43#define RAID_AUTORUN _IO (MD_MAJOR, 0x14)
44#define GET_BITMAP_FILE _IOR (MD_MAJOR, 0x15, mdu_bitmap_file_t)
45
46/* configuration */
47#define CLEAR_ARRAY _IO (MD_MAJOR, 0x20)
48#define ADD_NEW_DISK _IOW (MD_MAJOR, 0x21, mdu_disk_info_t)
49#define HOT_REMOVE_DISK _IO (MD_MAJOR, 0x22)
50#define SET_ARRAY_INFO _IOW (MD_MAJOR, 0x23, mdu_array_info_t)
51#define SET_DISK_INFO _IO (MD_MAJOR, 0x24)
52#define WRITE_RAID_INFO _IO (MD_MAJOR, 0x25)
53#define UNPROTECT_ARRAY _IO (MD_MAJOR, 0x26)
54#define PROTECT_ARRAY _IO (MD_MAJOR, 0x27)
55#define HOT_ADD_DISK _IO (MD_MAJOR, 0x28)
56#define SET_DISK_FAULTY _IO (MD_MAJOR, 0x29)
57#define HOT_GENERATE_ERROR _IO (MD_MAJOR, 0x2a)
58#define SET_BITMAP_FILE _IOW (MD_MAJOR, 0x2b, int)
18 59
60/* usage */
61#define RUN_ARRAY _IOW (MD_MAJOR, 0x30, mdu_param_t)
62/* 0x31 was START_ARRAY */
63#define STOP_ARRAY _IO (MD_MAJOR, 0x32)
64#define STOP_ARRAY_RO _IO (MD_MAJOR, 0x33)
65#define RESTART_ARRAY_RW _IO (MD_MAJOR, 0x34)
66
67/* 63 partitions with the alternate major number (mdp) */
68#define MdpMinorShift 6
69#ifdef __KERNEL__
19extern int mdp_major; 70extern int mdp_major;
71#endif
72
73typedef struct mdu_version_s {
74 int major;
75 int minor;
76 int patchlevel;
77} mdu_version_t;
78
79typedef struct mdu_array_info_s {
80 /*
81 * Generic constant information
82 */
83 int major_version;
84 int minor_version;
85 int patch_version;
86 int ctime;
87 int level;
88 int size;
89 int nr_disks;
90 int raid_disks;
91 int md_minor;
92 int not_persistent;
93
94 /*
95 * Generic state information
96 */
97 int utime; /* 0 Superblock update time */
98 int state; /* 1 State bits (clean, ...) */
99 int active_disks; /* 2 Number of currently active disks */
100 int working_disks; /* 3 Number of working disks */
101 int failed_disks; /* 4 Number of failed disks */
102 int spare_disks; /* 5 Number of spare disks */
103
104 /*
105 * Personality information
106 */
107 int layout; /* 0 the array's physical layout */
108 int chunk_size; /* 1 chunk size in bytes */
109
110} mdu_array_info_t;
111
112/* non-obvious values for 'level' */
113#define LEVEL_MULTIPATH (-4)
114#define LEVEL_LINEAR (-1)
115#define LEVEL_FAULTY (-5)
116
117/* we need a value for 'no level specified' and 0
118 * means 'raid0', so we need something else. This is
119 * for internal use only
120 */
121#define LEVEL_NONE (-1000000)
122
123typedef struct mdu_disk_info_s {
124 /*
125 * configuration/status of one particular disk
126 */
127 int number;
128 int major;
129 int minor;
130 int raid_disk;
131 int state;
132
133} mdu_disk_info_t;
134
135typedef struct mdu_start_info_s {
136 /*
137 * configuration/status of one particular disk
138 */
139 int major;
140 int minor;
141 int raid_disk;
142 int state;
143
144} mdu_start_info_t;
145
146typedef struct mdu_bitmap_file_s
147{
148 char pathname[4096];
149} mdu_bitmap_file_t;
150
151typedef struct mdu_param_s
152{
153 int personality; /* 1,2,3,4 */
154 int chunk_size; /* in bytes */
155 int max_fault; /* unused for now */
156} mdu_param_t;
157
20#endif 158#endif
159
diff --git a/include/linux/raid/pq.h b/include/linux/raid/pq.h
index 8dfaa2ce2e9..2b59cc82439 100644
--- a/include/linux/raid/pq.h
+++ b/include/linux/raid/pq.h
@@ -98,25 +98,9 @@ extern const struct raid6_calls raid6_altivec1;
98extern const struct raid6_calls raid6_altivec2; 98extern const struct raid6_calls raid6_altivec2;
99extern const struct raid6_calls raid6_altivec4; 99extern const struct raid6_calls raid6_altivec4;
100extern const struct raid6_calls raid6_altivec8; 100extern const struct raid6_calls raid6_altivec8;
101extern const struct raid6_calls raid6_avx2x1;
102extern const struct raid6_calls raid6_avx2x2;
103extern const struct raid6_calls raid6_avx2x4;
104
105struct raid6_recov_calls {
106 void (*data2)(int, size_t, int, int, void **);
107 void (*datap)(int, size_t, int, void **);
108 int (*valid)(void);
109 const char *name;
110 int priority;
111};
112
113extern const struct raid6_recov_calls raid6_recov_intx1;
114extern const struct raid6_recov_calls raid6_recov_ssse3;
115extern const struct raid6_recov_calls raid6_recov_avx2;
116 101
117/* Algorithm list */ 102/* Algorithm list */
118extern const struct raid6_calls * const raid6_algos[]; 103extern const struct raid6_calls * const raid6_algos[];
119extern const struct raid6_recov_calls *const raid6_recov_algos[];
120int raid6_select_algo(void); 104int raid6_select_algo(void);
121 105
122/* Return values from chk_syndrome */ 106/* Return values from chk_syndrome */
@@ -127,16 +111,14 @@ int raid6_select_algo(void);
127 111
128/* Galois field tables */ 112/* Galois field tables */
129extern const u8 raid6_gfmul[256][256] __attribute__((aligned(256))); 113extern const u8 raid6_gfmul[256][256] __attribute__((aligned(256)));
130extern const u8 raid6_vgfmul[256][32] __attribute__((aligned(256)));
131extern const u8 raid6_gfexp[256] __attribute__((aligned(256))); 114extern const u8 raid6_gfexp[256] __attribute__((aligned(256)));
132extern const u8 raid6_gfinv[256] __attribute__((aligned(256))); 115extern const u8 raid6_gfinv[256] __attribute__((aligned(256)));
133extern const u8 raid6_gfexi[256] __attribute__((aligned(256))); 116extern const u8 raid6_gfexi[256] __attribute__((aligned(256)));
134 117
135/* Recovery routines */ 118/* Recovery routines */
136extern void (*raid6_2data_recov)(int disks, size_t bytes, int faila, int failb, 119void raid6_2data_recov(int disks, size_t bytes, int faila, int failb,
137 void **ptrs); 120 void **ptrs);
138extern void (*raid6_datap_recov)(int disks, size_t bytes, int faila, 121void raid6_datap_recov(int disks, size_t bytes, int faila, void **ptrs);
139 void **ptrs);
140void raid6_dual_recov(int disks, size_t bytes, int faila, int failb, 122void raid6_dual_recov(int disks, size_t bytes, int faila, int failb,
141 void **ptrs); 123 void **ptrs);
142 124
@@ -150,7 +132,7 @@ void raid6_dual_recov(int disks, size_t bytes, int faila, int failb,
150 PROT_READ|PROT_WRITE, \ 132 PROT_READ|PROT_WRITE, \
151 MAP_PRIVATE|MAP_ANONYMOUS,\ 133 MAP_PRIVATE|MAP_ANONYMOUS,\
152 0, 0)) 134 0, 0))
153# define free_pages(x, y) munmap((void *)(x), PAGE_SIZE << (y)) 135# define free_pages(x, y) munmap((void *)(x), (y)*PAGE_SIZE)
154 136
155static inline void cpu_relax(void) 137static inline void cpu_relax(void)
156{ 138{