drbd_state_change.h 2.0 KB

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