0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016 #ifndef _UAPI_MD_U_H
0017 #define _UAPI_MD_U_H
0018
0019
0020
0021
0022
0023
0024 #define MD_MAJOR_VERSION 0
0025 #define MD_MINOR_VERSION 90
0026
0027
0028
0029
0030
0031
0032
0033
0034
0035 #define MD_PATCHLEVEL_VERSION 3
0036
0037
0038
0039
0040 #define RAID_VERSION _IOR (MD_MAJOR, 0x10, mdu_version_t)
0041 #define GET_ARRAY_INFO _IOR (MD_MAJOR, 0x11, mdu_array_info_t)
0042 #define GET_DISK_INFO _IOR (MD_MAJOR, 0x12, mdu_disk_info_t)
0043 #define RAID_AUTORUN _IO (MD_MAJOR, 0x14)
0044 #define GET_BITMAP_FILE _IOR (MD_MAJOR, 0x15, mdu_bitmap_file_t)
0045
0046
0047 #define CLEAR_ARRAY _IO (MD_MAJOR, 0x20)
0048 #define ADD_NEW_DISK _IOW (MD_MAJOR, 0x21, mdu_disk_info_t)
0049 #define HOT_REMOVE_DISK _IO (MD_MAJOR, 0x22)
0050 #define SET_ARRAY_INFO _IOW (MD_MAJOR, 0x23, mdu_array_info_t)
0051 #define SET_DISK_INFO _IO (MD_MAJOR, 0x24)
0052 #define WRITE_RAID_INFO _IO (MD_MAJOR, 0x25)
0053 #define UNPROTECT_ARRAY _IO (MD_MAJOR, 0x26)
0054 #define PROTECT_ARRAY _IO (MD_MAJOR, 0x27)
0055 #define HOT_ADD_DISK _IO (MD_MAJOR, 0x28)
0056 #define SET_DISK_FAULTY _IO (MD_MAJOR, 0x29)
0057 #define HOT_GENERATE_ERROR _IO (MD_MAJOR, 0x2a)
0058 #define SET_BITMAP_FILE _IOW (MD_MAJOR, 0x2b, int)
0059
0060
0061 #define RUN_ARRAY _IOW (MD_MAJOR, 0x30, mdu_param_t)
0062
0063 #define STOP_ARRAY _IO (MD_MAJOR, 0x32)
0064 #define STOP_ARRAY_RO _IO (MD_MAJOR, 0x33)
0065 #define RESTART_ARRAY_RW _IO (MD_MAJOR, 0x34)
0066 #define CLUSTERED_DISK_NACK _IO (MD_MAJOR, 0x35)
0067
0068
0069 #define MdpMinorShift 6
0070
0071 typedef struct mdu_version_s {
0072 int major;
0073 int minor;
0074 int patchlevel;
0075 } mdu_version_t;
0076
0077 typedef struct mdu_array_info_s {
0078
0079
0080
0081 int major_version;
0082 int minor_version;
0083 int patch_version;
0084 unsigned int ctime;
0085 int level;
0086 int size;
0087 int nr_disks;
0088 int raid_disks;
0089 int md_minor;
0090 int not_persistent;
0091
0092
0093
0094
0095 unsigned int utime;
0096 int state;
0097 int active_disks;
0098 int working_disks;
0099 int failed_disks;
0100 int spare_disks;
0101
0102
0103
0104
0105 int layout;
0106 int chunk_size;
0107
0108 } mdu_array_info_t;
0109
0110
0111 #define LEVEL_MULTIPATH (-4)
0112 #define LEVEL_LINEAR (-1)
0113 #define LEVEL_FAULTY (-5)
0114
0115
0116
0117
0118
0119 #define LEVEL_NONE (-1000000)
0120
0121 typedef struct mdu_disk_info_s {
0122
0123
0124
0125 int number;
0126 int major;
0127 int minor;
0128 int raid_disk;
0129 int state;
0130
0131 } mdu_disk_info_t;
0132
0133 typedef struct mdu_start_info_s {
0134
0135
0136
0137 int major;
0138 int minor;
0139 int raid_disk;
0140 int state;
0141
0142 } mdu_start_info_t;
0143
0144 typedef struct mdu_bitmap_file_s
0145 {
0146 char pathname[4096];
0147 } mdu_bitmap_file_t;
0148
0149 typedef struct mdu_param_s
0150 {
0151 int personality;
0152 int chunk_size;
0153 int max_fault;
0154 } mdu_param_t;
0155
0156 #endif