]> git.ipfire.org Git - thirdparty/mdadm.git/blame - mdmon.h
imsm: set map state depending on sync state
[thirdparty/mdadm.git] / mdmon.h
CommitLineData
549e9569
NB
1
2enum array_state { clear, inactive, suspended, readonly, read_auto,
3 clean, active, write_pending, active_idle, bad_word};
4
5enum sync_action { idle, reshape, resync, recover, check, repair, bad_action };
6
7
8struct active_array {
9 struct mdinfo info;
10 struct supertype *container;
11 struct active_array *next, *replaces;
12
13 int action_fd;
c052ba30 14 int resync_start_fd;
549e9569
NB
15
16 enum array_state prev_state, curr_state, next_state;
17 enum sync_action prev_action, curr_action, next_action;
18
6c3fb95c
NB
19 int check_degraded; /* flag set by mon, read by manage */
20
549e9569
NB
21 int devnum;
22
c052ba30 23 unsigned long long resync_start;
549e9569
NB
24};
25
2e735d19
NB
26/*
27 * Metadata updates are handled by the monitor thread,
28 * as it has exclusive access to the metadata.
29 * When the manager want to updates metadata, either
30 * for it's own reason (e.g. committing a spare) or
31 * on behalf of mdadm, it creates a metadata_update
32 * structure and queues it to the monitor.
33 * Updates are created and processed by code under the
34 * superswitch. All common code sees them as opaque
35 * blobs.
36 */
37struct metadata_update {
38 int len;
39 char *buf;
40 void *space; /* allocated space that monitor will use */
41 struct metadata_update *next;
42};
43extern struct metadata_update *update_queue, *update_queue_handled;
549e9569
NB
44
45#define MD_MAJOR 9
46
47extern struct active_array *container;
549e9569
NB
48extern struct active_array *discard_this;
49extern struct active_array *pending_discard;
3e70c845 50extern struct md_generic_cmd *active_cmd;
549e9569
NB
51
52
e0d6609f 53void remove_pidfile(char *devname);
549e9569
NB
54void do_monitor(struct supertype *container);
55void do_manager(struct supertype *container);
56
57int read_dev_state(int fd);
58
59struct mdstat_ent *mdstat_read(int hold, int start);
60
61extern struct superswitch super_ddf, super_ddf_bvd, super_ddf_svd;
e0d6609f
NB
62
63extern int exit_now, manager_ready;