]> git.ipfire.org Git - thirdparty/mdadm.git/blame - md_u.h
mdadm: load default sysfs attributes after assemblation
[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)
64c4757e 24#define RAID_AUTORUN _IO (MD_MAJOR, 0x14)
c82f047c 25#define GET_BITMAP_FILE _IOR (MD_MAJOR, 0x15, mdu_bitmap_file_t)
64c4757e
NB
26
27/* configuration */
64c4757e
NB
28#define ADD_NEW_DISK _IOW (MD_MAJOR, 0x21, mdu_disk_info_t)
29#define HOT_REMOVE_DISK _IO (MD_MAJOR, 0x22)
30#define SET_ARRAY_INFO _IOW (MD_MAJOR, 0x23, mdu_array_info_t)
64c4757e
NB
31#define HOT_ADD_DISK _IO (MD_MAJOR, 0x28)
32#define SET_DISK_FAULTY _IO (MD_MAJOR, 0x29)
c82f047c 33#define SET_BITMAP_FILE _IOW (MD_MAJOR, 0x2b, int)
64c4757e
NB
34
35/* usage */
36#define RUN_ARRAY _IOW (MD_MAJOR, 0x30, mdu_param_t)
64c4757e
NB
37#define STOP_ARRAY _IO (MD_MAJOR, 0x32)
38#define STOP_ARRAY_RO _IO (MD_MAJOR, 0x33)
39#define RESTART_ARRAY_RW _IO (MD_MAJOR, 0x34)
4de90913 40#define CLUSTERED_DISK_NACK _IO (MD_MAJOR, 0x35)
64c4757e
NB
41
42typedef struct mdu_version_s {
43 int major;
44 int minor;
45 int patchlevel;
46} mdu_version_t;
47
48typedef struct mdu_array_info_s {
49 /*
50 * Generic constant information
51 */
52 int major_version;
53 int minor_version;
54 int patch_version;
26714713 55 unsigned int ctime;
64c4757e
NB
56 int level;
57 int size;
58 int nr_disks;
59 int raid_disks;
60 int md_minor;
61 int not_persistent;
62
63 /*
64 * Generic state information
65 */
26714713 66 unsigned int utime; /* 0 Superblock update time */
64c4757e
NB
67 int state; /* 1 State bits (clean, ...) */
68 int active_disks; /* 2 Number of currently active disks */
69 int working_disks; /* 3 Number of working disks */
70 int failed_disks; /* 4 Number of failed disks */
71 int spare_disks; /* 5 Number of spare disks */
72
73 /*
74 * Personality information
75 */
76 int layout; /* 0 the array's physical layout */
77 int chunk_size; /* 1 chunk size in bytes */
78
79} mdu_array_info_t;
80
81typedef struct mdu_disk_info_s {
82 /*
83 * configuration/status of one particular disk
84 */
85 int number;
86 int major;
87 int minor;
88 int raid_disk;
89 int state;
90
91} mdu_disk_info_t;
92
93typedef struct mdu_start_info_s {
94 /*
95 * configuration/status of one particular disk
96 */
97 int major;
98 int minor;
99 int raid_disk;
100 int state;
101
102} mdu_start_info_t;
103
c82f047c
NB
104typedef struct mdu_bitmap_file_s
105{
106 char pathname[4096];
107} mdu_bitmap_file_t;
108
64c4757e
NB
109typedef struct mdu_param_s
110{
111 int personality; /* 1,2,3,4 */
112 int chunk_size; /* in bytes */
113 int max_fault; /* unused for now */
114} mdu_param_t;
115
aba69144 116#endif