]> git.ipfire.org Git - thirdparty/mdadm.git/blame - md_u.h
imsm: remove redundant characters from some error messages
[thirdparty/mdadm.git] / md_u.h
CommitLineData
64c4757e
NB
1/*
2 md_u.h : user <=> kernel API between Linux raidtools and RAID drivers
3 Copyright (C) 1998 Ingo Molnar
aba69144 4
64c4757e
NB
5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 2, or (at your option)
8 any later version.
aba69144 9
64c4757e
NB
10 You should have received a copy of the GNU General Public License
11 (for example /usr/src/linux/COPYING); if not, write to the Free
aba69144 12 Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
64c4757e
NB
13*/
14
15#ifndef _MD_U_H
16#define _MD_U_H
17
18/* ioctls */
19
20/* status */
21#define RAID_VERSION _IOR (MD_MAJOR, 0x10, mdu_version_t)
22#define GET_ARRAY_INFO _IOR (MD_MAJOR, 0x11, mdu_array_info_t)
23#define GET_DISK_INFO _IOR (MD_MAJOR, 0x12, mdu_disk_info_t)
24#define PRINT_RAID_DEBUG _IO (MD_MAJOR, 0x13)
25#define RAID_AUTORUN _IO (MD_MAJOR, 0x14)
c82f047c 26#define GET_BITMAP_FILE _IOR (MD_MAJOR, 0x15, mdu_bitmap_file_t)
64c4757e
NB
27
28/* configuration */
29#define CLEAR_ARRAY _IO (MD_MAJOR, 0x20)
30#define ADD_NEW_DISK _IOW (MD_MAJOR, 0x21, mdu_disk_info_t)
31#define HOT_REMOVE_DISK _IO (MD_MAJOR, 0x22)
32#define SET_ARRAY_INFO _IOW (MD_MAJOR, 0x23, mdu_array_info_t)
33#define SET_DISK_INFO _IO (MD_MAJOR, 0x24)
34#define WRITE_RAID_INFO _IO (MD_MAJOR, 0x25)
35#define UNPROTECT_ARRAY _IO (MD_MAJOR, 0x26)
36#define PROTECT_ARRAY _IO (MD_MAJOR, 0x27)
37#define HOT_ADD_DISK _IO (MD_MAJOR, 0x28)
38#define SET_DISK_FAULTY _IO (MD_MAJOR, 0x29)
c82f047c 39#define SET_BITMAP_FILE _IOW (MD_MAJOR, 0x2b, int)
64c4757e
NB
40
41/* usage */
42#define RUN_ARRAY _IOW (MD_MAJOR, 0x30, mdu_param_t)
43#define START_ARRAY _IO (MD_MAJOR, 0x31)
44#define STOP_ARRAY _IO (MD_MAJOR, 0x32)
45#define STOP_ARRAY_RO _IO (MD_MAJOR, 0x33)
46#define RESTART_ARRAY_RW _IO (MD_MAJOR, 0x34)
4de90913 47#define CLUSTERED_DISK_NACK _IO (MD_MAJOR, 0x35)
64c4757e
NB
48
49typedef struct mdu_version_s {
50 int major;
51 int minor;
52 int patchlevel;
53} mdu_version_t;
54
55typedef struct mdu_array_info_s {
56 /*
57 * Generic constant information
58 */
59 int major_version;
60 int minor_version;
61 int patch_version;
26714713 62 unsigned int ctime;
64c4757e
NB
63 int level;
64 int size;
65 int nr_disks;
66 int raid_disks;
67 int md_minor;
68 int not_persistent;
69
70 /*
71 * Generic state information
72 */
26714713 73 unsigned int utime; /* 0 Superblock update time */
64c4757e
NB
74 int state; /* 1 State bits (clean, ...) */
75 int active_disks; /* 2 Number of currently active disks */
76 int working_disks; /* 3 Number of working disks */
77 int failed_disks; /* 4 Number of failed disks */
78 int spare_disks; /* 5 Number of spare disks */
79
80 /*
81 * Personality information
82 */
83 int layout; /* 0 the array's physical layout */
84 int chunk_size; /* 1 chunk size in bytes */
85
86} mdu_array_info_t;
87
88typedef struct mdu_disk_info_s {
89 /*
90 * configuration/status of one particular disk
91 */
92 int number;
93 int major;
94 int minor;
95 int raid_disk;
96 int state;
97
98} mdu_disk_info_t;
99
100typedef struct mdu_start_info_s {
101 /*
102 * configuration/status of one particular disk
103 */
104 int major;
105 int minor;
106 int raid_disk;
107 int state;
108
109} mdu_start_info_t;
110
c82f047c
NB
111typedef struct mdu_bitmap_file_s
112{
113 char pathname[4096];
114} mdu_bitmap_file_t;
115
64c4757e
NB
116typedef struct mdu_param_s
117{
118 int personality; /* 1,2,3,4 */
119 int chunk_size; /* in bytes */
120 int max_fault; /* unused for now */
121} mdu_param_t;
122
aba69144 123#endif