1 #ifndef DRBD_STATE_CHANGE_H
2 #define DRBD_STATE_CHANGE_H
3 
4 struct drbd_resource_state_change {
5 	struct drbd_resource *resource;
6 	enum drbd_role role[2];
7 	bool susp[2];
8 	bool susp_nod[2];
9 	bool susp_fen[2];
10 };
11 
12 struct drbd_device_state_change {
13 	struct drbd_device *device;
14 	enum drbd_disk_state disk_state[2];
15 };
16 
17 struct drbd_connection_state_change {
18 	struct drbd_connection *connection;
19 	enum drbd_conns cstate[2];  /* drbd9: enum drbd_conn_state */
20 	enum drbd_role peer_role[2];
21 };
22 
23 struct drbd_peer_device_state_change {
24 	struct drbd_peer_device *peer_device;
25 	enum drbd_disk_state disk_state[2];
26 	enum drbd_conns repl_state[2];  /* drbd9: enum drbd_repl_state */
27 	bool resync_susp_user[2];
28 	bool resync_susp_peer[2];
29 	bool resync_susp_dependency[2];
30 };
31 
32 struct drbd_state_change {
33 	struct list_head list;
34 	unsigned int n_devices;
35 	unsigned int n_connections;
36 	struct drbd_resource_state_change resource[1];
37 	struct drbd_device_state_change *devices;
38 	struct drbd_connection_state_change *connections;
39 	struct drbd_peer_device_state_change *peer_devices;
40 };
41 
42 extern struct drbd_state_change *remember_old_state(struct drbd_resource *, gfp_t);
43 extern void copy_old_to_new_state_change(struct drbd_state_change *);
44 extern void forget_state_change(struct drbd_state_change *);
45 
46 extern void notify_resource_state_change(struct sk_buff *,
47 					 unsigned int,
48 					 struct drbd_resource_state_change *,
49 					 enum drbd_notification_type type);
50 extern void notify_connection_state_change(struct sk_buff *,
51 					   unsigned int,
52 					   struct drbd_connection_state_change *,
53 					   enum drbd_notification_type type);
54 extern void notify_device_state_change(struct sk_buff *,
55 				       unsigned int,
56 				       struct drbd_device_state_change *,
57 				       enum drbd_notification_type type);
58 extern void notify_peer_device_state_change(struct sk_buff *,
59 					    unsigned int,
60 					    struct drbd_peer_device_state_change *,
61 					    enum drbd_notification_type type);
62 
63 #endif  /* DRBD_STATE_CHANGE_H */
64