aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/block/drbd/drbd_int.h
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/block/drbd/drbd_int.h')
-rw-r--r--drivers/block/drbd/drbd_int.h18
1 files changed, 10 insertions, 8 deletions
diff --git a/drivers/block/drbd/drbd_int.h b/drivers/block/drbd/drbd_int.h
index 3f379ff779b2..af68d64a0faf 100644
--- a/drivers/block/drbd/drbd_int.h
+++ b/drivers/block/drbd/drbd_int.h
@@ -580,6 +580,10 @@ struct drbd_resource {
580 struct res_opts res_opts; 580 struct res_opts res_opts;
581 struct mutex conf_update; /* mutex for ready-copy-update of net_conf and disk_conf */ 581 struct mutex conf_update; /* mutex for ready-copy-update of net_conf and disk_conf */
582 spinlock_t req_lock; 582 spinlock_t req_lock;
583
584 unsigned susp:1; /* IO suspended by user */
585 unsigned susp_nod:1; /* IO suspended because no data */
586 unsigned susp_fen:1; /* IO suspended because fence peer handler runs */
583}; 587};
584 588
585struct drbd_connection { 589struct drbd_connection {
@@ -588,9 +592,6 @@ struct drbd_connection {
588 struct kref kref; 592 struct kref kref;
589 struct idr peer_devices; /* volume number to peer device mapping */ 593 struct idr peer_devices; /* volume number to peer device mapping */
590 enum drbd_conns cstate; /* Only C_STANDALONE to C_WF_REPORT_PARAMS */ 594 enum drbd_conns cstate; /* Only C_STANDALONE to C_WF_REPORT_PARAMS */
591 unsigned susp:1; /* IO suspended by user */
592 unsigned susp_nod:1; /* IO suspended because no data */
593 unsigned susp_fen:1; /* IO suspended because fence peer handler runs */
594 struct mutex cstate_mutex; /* Protects graceful disconnects */ 595 struct mutex cstate_mutex; /* Protects graceful disconnects */
595 unsigned int connect_cnt; /* Inc each time a connection is established */ 596 unsigned int connect_cnt; /* Inc each time a connection is established */
596 597
@@ -1507,12 +1508,13 @@ _drbd_set_state(struct drbd_device *device, union drbd_state ns,
1507 1508
1508static inline union drbd_state drbd_read_state(struct drbd_device *device) 1509static inline union drbd_state drbd_read_state(struct drbd_device *device)
1509{ 1510{
1511 struct drbd_resource *resource = device->resource;
1510 union drbd_state rv; 1512 union drbd_state rv;
1511 1513
1512 rv.i = device->state.i; 1514 rv.i = device->state.i;
1513 rv.susp = first_peer_device(device)->connection->susp; 1515 rv.susp = resource->susp;
1514 rv.susp_nod = first_peer_device(device)->connection->susp_nod; 1516 rv.susp_nod = resource->susp_nod;
1515 rv.susp_fen = first_peer_device(device)->connection->susp_fen; 1517 rv.susp_fen = resource->susp_fen;
1516 1518
1517 return rv; 1519 return rv;
1518} 1520}
@@ -2033,9 +2035,9 @@ static inline int drbd_state_is_stable(struct drbd_device *device)
2033 2035
2034static inline int drbd_suspended(struct drbd_device *device) 2036static inline int drbd_suspended(struct drbd_device *device)
2035{ 2037{
2036 struct drbd_connection *connection = first_peer_device(device)->connection; 2038 struct drbd_resource *resource = device->resource;
2037 2039
2038 return connection->susp || connection->susp_fen || connection->susp_nod; 2040 return resource->susp || resource->susp_fen || resource->susp_nod;
2039} 2041}
2040 2042
2041static inline bool may_inc_ap_bio(struct drbd_device *device) 2043static inline bool may_inc_ap_bio(struct drbd_device *device)