blob: d5b0479bc9a6649e6bd423d5793861e5fa0022f6 [file] [log] [blame]
Greg Kroah-Hartmanb2441312017-11-01 15:07:57 +01001/* SPDX-License-Identifier: GPL-2.0 */
Andreas Gruenbachera2972842014-07-31 17:41:33 +02002#ifndef DRBD_STATE_CHANGE_H
3#define DRBD_STATE_CHANGE_H
4
5struct drbd_resource_state_change {
6 struct drbd_resource *resource;
7 enum drbd_role role[2];
8 bool susp[2];
9 bool susp_nod[2];
10 bool susp_fen[2];
11};
12
13struct drbd_device_state_change {
14 struct drbd_device *device;
15 enum drbd_disk_state disk_state[2];
16};
17
18struct drbd_connection_state_change {
19 struct drbd_connection *connection;
20 enum drbd_conns cstate[2]; /* drbd9: enum drbd_conn_state */
21 enum drbd_role peer_role[2];
22};
23
24struct drbd_peer_device_state_change {
25 struct drbd_peer_device *peer_device;
26 enum drbd_disk_state disk_state[2];
27 enum drbd_conns repl_state[2]; /* drbd9: enum drbd_repl_state */
28 bool resync_susp_user[2];
29 bool resync_susp_peer[2];
30 bool resync_susp_dependency[2];
31};
32
33struct drbd_state_change {
34 struct list_head list;
35 unsigned int n_devices;
36 unsigned int n_connections;
37 struct drbd_resource_state_change resource[1];
38 struct drbd_device_state_change *devices;
39 struct drbd_connection_state_change *connections;
40 struct drbd_peer_device_state_change *peer_devices;
41};
42
43extern struct drbd_state_change *remember_old_state(struct drbd_resource *, gfp_t);
44extern void copy_old_to_new_state_change(struct drbd_state_change *);
45extern void forget_state_change(struct drbd_state_change *);
46
Lv Yunlongdcf6be12022-04-06 21:04:43 +020047extern int notify_resource_state_change(struct sk_buff *,
Andreas Gruenbachera2972842014-07-31 17:41:33 +020048 unsigned int,
49 struct drbd_resource_state_change *,
50 enum drbd_notification_type type);
Lv Yunlongdcf6be12022-04-06 21:04:43 +020051extern int notify_connection_state_change(struct sk_buff *,
Andreas Gruenbachera2972842014-07-31 17:41:33 +020052 unsigned int,
53 struct drbd_connection_state_change *,
54 enum drbd_notification_type type);
Lv Yunlongdcf6be12022-04-06 21:04:43 +020055extern int notify_device_state_change(struct sk_buff *,
Andreas Gruenbachera2972842014-07-31 17:41:33 +020056 unsigned int,
57 struct drbd_device_state_change *,
58 enum drbd_notification_type type);
Lv Yunlongdcf6be12022-04-06 21:04:43 +020059extern int notify_peer_device_state_change(struct sk_buff *,
Andreas Gruenbachera2972842014-07-31 17:41:33 +020060 unsigned int,
61 struct drbd_peer_device_state_change *,
62 enum drbd_notification_type type);
63
64#endif /* DRBD_STATE_CHANGE_H */