1 /* SPDX-License-Identifier: GPL-2.0 */
2 #ifndef DRBD_STATE_CHANGE_H
3 #define DRBD_STATE_CHANGE_H
5 struct drbd_resource_state_change
{
6 struct drbd_resource
*resource
;
7 enum drbd_role role
[2];
13 struct drbd_device_state_change
{
14 struct drbd_device
*device
;
15 enum drbd_disk_state disk_state
[2];
18 struct 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];
24 struct 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];
33 struct 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
;
43 extern struct drbd_state_change
*remember_old_state(struct drbd_resource
*, gfp_t
);
44 extern void copy_old_to_new_state_change(struct drbd_state_change
*);
45 extern void forget_state_change(struct drbd_state_change
*);
47 extern void notify_resource_state_change(struct sk_buff
*,
49 struct drbd_resource_state_change
*,
50 enum drbd_notification_type type
);
51 extern void notify_connection_state_change(struct sk_buff
*,
53 struct drbd_connection_state_change
*,
54 enum drbd_notification_type type
);
55 extern void notify_device_state_change(struct sk_buff
*,
57 struct drbd_device_state_change
*,
58 enum drbd_notification_type type
);
59 extern void notify_peer_device_state_change(struct sk_buff
*,
61 struct drbd_peer_device_state_change
*,
62 enum drbd_notification_type type
);
64 #endif /* DRBD_STATE_CHANGE_H */