diff options
author | Philipp Reisner <philipp.reisner@linbit.com> | 2011-03-28 10:18:39 -0400 |
---|---|---|
committer | Philipp Reisner <philipp.reisner@linbit.com> | 2012-11-08 10:45:03 -0500 |
commit | 8e0af25fa85c9efe393128b0a0dd874981edb22f (patch) | |
tree | e7496473c3cb9b93410e678925c0bd26e8722e8e | |
parent | 2aebfabb17ecc434623732896a5834a9cb82a82d (diff) |
drbd: Moved susp, susp_nod and susp_fen to the connection object
Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
-rw-r--r-- | drivers/block/drbd/drbd_int.h | 10 | ||||
-rw-r--r-- | drivers/block/drbd/drbd_state.c | 3 |
2 files changed, 12 insertions, 1 deletions
diff --git a/drivers/block/drbd/drbd_int.h b/drivers/block/drbd/drbd_int.h index cde547bdddf1..f76b3932d1e2 100644 --- a/drivers/block/drbd/drbd_int.h +++ b/drivers/block/drbd/drbd_int.h | |||
@@ -862,6 +862,9 @@ struct drbd_tconn { /* is a resource from the config file */ | |||
862 | struct list_head all_tconn; /* linked on global drbd_tconns */ | 862 | struct list_head all_tconn; /* linked on global drbd_tconns */ |
863 | struct idr volumes; /* <tconn, vnr> to mdev mapping */ | 863 | struct idr volumes; /* <tconn, vnr> to mdev mapping */ |
864 | enum drbd_conns cstate; /* Only C_STANDALONE to C_WF_REPORT_PARAMS */ | 864 | enum drbd_conns cstate; /* Only C_STANDALONE to C_WF_REPORT_PARAMS */ |
865 | unsigned susp:1; /* IO suspended by user */ | ||
866 | unsigned susp_nod:1; /* IO suspended because no data */ | ||
867 | unsigned susp_fen:1; /* IO suspended because fence peer handler runs */ | ||
865 | struct mutex cstate_mutex; /* Protects graceful disconnects */ | 868 | struct mutex cstate_mutex; /* Protects graceful disconnects */ |
866 | 869 | ||
867 | unsigned long flags; | 870 | unsigned long flags; |
@@ -1687,6 +1690,9 @@ static inline union drbd_state drbd_read_state(struct drbd_conf *mdev) | |||
1687 | union drbd_state rv; | 1690 | union drbd_state rv; |
1688 | 1691 | ||
1689 | rv = mdev->state; | 1692 | rv = mdev->state; |
1693 | rv.susp = mdev->tconn->susp; | ||
1694 | rv.susp_nod = mdev->tconn->susp_nod; | ||
1695 | rv.susp_fen = mdev->tconn->susp_fen; | ||
1690 | 1696 | ||
1691 | return rv; | 1697 | return rv; |
1692 | } | 1698 | } |
@@ -2219,7 +2225,9 @@ static inline int drbd_state_is_stable(struct drbd_conf *mdev) | |||
2219 | 2225 | ||
2220 | static inline int drbd_suspended(struct drbd_conf *mdev) | 2226 | static inline int drbd_suspended(struct drbd_conf *mdev) |
2221 | { | 2227 | { |
2222 | return mdev->state.susp || mdev->state.susp_nod || mdev->state.susp_fen; | 2228 | struct drbd_tconn *tconn = mdev->tconn; |
2229 | |||
2230 | return tconn->susp || tconn->susp_fen || tconn->susp_nod; | ||
2223 | } | 2231 | } |
2224 | 2232 | ||
2225 | static inline bool may_inc_ap_bio(struct drbd_conf *mdev) | 2233 | static inline bool may_inc_ap_bio(struct drbd_conf *mdev) |
diff --git a/drivers/block/drbd/drbd_state.c b/drivers/block/drbd/drbd_state.c index ae4a76ce8c1d..902007c807ea 100644 --- a/drivers/block/drbd/drbd_state.c +++ b/drivers/block/drbd/drbd_state.c | |||
@@ -861,6 +861,9 @@ __drbd_set_state(struct drbd_conf *mdev, union drbd_state ns, | |||
861 | atomic_inc(&mdev->local_cnt); | 861 | atomic_inc(&mdev->local_cnt); |
862 | 862 | ||
863 | mdev->state = ns; | 863 | mdev->state = ns; |
864 | mdev->tconn->susp = ns.susp; | ||
865 | mdev->tconn->susp_nod = ns.susp_nod; | ||
866 | mdev->tconn->susp_fen = ns.susp_fen; | ||
864 | 867 | ||
865 | /* solve the race between becoming unconfigured, | 868 | /* solve the race between becoming unconfigured, |
866 | * worker doing the cleanup, and | 869 | * worker doing the cleanup, and |