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 RAID_AUTORUN _IO (MD_MAJOR, 0x14)
43#define GET_BITMAP_FILE _IOR (MD_MAJOR, 0x15, mdu_bitmap_file_t)
44
45
46#define CLEAR_ARRAY _IO (MD_MAJOR, 0x20)
47#define ADD_NEW_DISK _IOW (MD_MAJOR, 0x21, mdu_disk_info_t)
48#define HOT_REMOVE_DISK _IO (MD_MAJOR, 0x22)
49#define SET_ARRAY_INFO _IOW (MD_MAJOR, 0x23, mdu_array_info_t)
50#define SET_DISK_INFO _IO (MD_MAJOR, 0x24)
51#define WRITE_RAID_INFO _IO (MD_MAJOR, 0x25)
52#define UNPROTECT_ARRAY _IO (MD_MAJOR, 0x26)
53#define PROTECT_ARRAY _IO (MD_MAJOR, 0x27)
54#define HOT_ADD_DISK _IO (MD_MAJOR, 0x28)
55#define SET_DISK_FAULTY _IO (MD_MAJOR, 0x29)
56#define HOT_GENERATE_ERROR _IO (MD_MAJOR, 0x2a)
57#define SET_BITMAP_FILE _IOW (MD_MAJOR, 0x2b, int)
58
59
60#define RUN_ARRAY _IOW (MD_MAJOR, 0x30, mdu_param_t)
61
62#define STOP_ARRAY _IO (MD_MAJOR, 0x32)
63#define STOP_ARRAY_RO _IO (MD_MAJOR, 0x33)
64#define RESTART_ARRAY_RW _IO (MD_MAJOR, 0x34)
65
66
67#define MdpMinorShift 6
68
69typedef struct mdu_version_s {
70 int major;
71 int minor;
72 int patchlevel;
73} mdu_version_t;
74
75typedef struct mdu_array_info_s {
76
77
78
79 int major_version;
80 int minor_version;
81 int patch_version;
82 int ctime;
83 int level;
84 int size;
85 int nr_disks;
86 int raid_disks;
87 int md_minor;
88 int not_persistent;
89
90
91
92
93 int utime;
94 int state;
95 int active_disks;
96 int working_disks;
97 int failed_disks;
98 int spare_disks;
99
100
101
102
103 int layout;
104 int chunk_size;
105
106} mdu_array_info_t;
107
108
109#define LEVEL_MULTIPATH (-4)
110#define LEVEL_LINEAR (-1)
111#define LEVEL_FAULTY (-5)
112
113
114
115
116
117#define LEVEL_NONE (-1000000)
118
119typedef struct mdu_disk_info_s {
120
121
122
123 int number;
124 int major;
125 int minor;
126 int raid_disk;
127 int state;
128
129} mdu_disk_info_t;
130
131typedef struct mdu_start_info_s {
132
133
134
135 int major;
136 int minor;
137 int raid_disk;
138 int state;
139
140} mdu_start_info_t;
141
142typedef struct mdu_bitmap_file_s
143{
144 char pathname[4096];
145} mdu_bitmap_file_t;
146
147typedef struct mdu_param_s
148{
149 int personality;
150 int chunk_size;
151 int max_fault;
152} mdu_param_t;
153
154#endif
155