1
2
3
4
5
6
7
8
9
10
11
12
13
14
15#ifndef _UAPI_MD_U_H
16#define _UAPI_MD_U_H
17
18
19
20
21
22
23#define MD_MAJOR_VERSION 0
24#define MD_MINOR_VERSION 90
25
26
27
28
29
30
31
32
33
34#define MD_PATCHLEVEL_VERSION 3
35
36
37
38
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
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)
59
60
61#define RUN_ARRAY _IOW (MD_MAJOR, 0x30, mdu_param_t)
62
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
68#define MdpMinorShift 6
69
70typedef struct mdu_version_s {
71 int major;
72 int minor;
73 int patchlevel;
74} mdu_version_t;
75
76typedef struct mdu_array_info_s {
77
78
79
80 int major_version;
81 int minor_version;
82 int patch_version;
83 int ctime;
84 int level;
85 int size;
86 int nr_disks;
87 int raid_disks;
88 int md_minor;
89 int not_persistent;
90
91
92
93
94 int utime;
95 int state;
96 int active_disks;
97 int working_disks;
98 int failed_disks;
99 int spare_disks;
100
101
102
103
104 int layout;
105 int chunk_size;
106
107} mdu_array_info_t;
108
109
110#define LEVEL_MULTIPATH (-4)
111#define LEVEL_LINEAR (-1)
112#define LEVEL_FAULTY (-5)
113
114
115
116
117
118#define LEVEL_NONE (-1000000)
119
120typedef struct mdu_disk_info_s {
121
122
123
124 int number;
125 int major;
126 int minor;
127 int raid_disk;
128 int state;
129
130} mdu_disk_info_t;
131
132typedef struct mdu_start_info_s {
133
134
135
136 int major;
137 int minor;
138 int raid_disk;
139 int state;
140
141} mdu_start_info_t;
142
143typedef struct mdu_bitmap_file_s
144{
145 char pathname[4096];
146} mdu_bitmap_file_t;
147
148typedef struct mdu_param_s
149{
150 int personality;
151 int chunk_size;
152 int max_fault;
153} mdu_param_t;
154
155#endif
156