diff options
author | Philipp Reisner <philipp.reisner@linbit.com> | 2010-09-08 17:20:21 -0400 |
---|---|---|
committer | Philipp Reisner <philipp.reisner@linbit.com> | 2010-10-14 12:38:40 -0400 |
commit | fb22c402ffdf61dd121795b5809de587185d5240 (patch) | |
tree | 7c3de5410eff21b3a3b105dc63d5e2034f2c7c63 /drivers/block/drbd/drbd_int.h | |
parent | 78db89287ce0f146a1f2a019a0b243ea4557caac (diff) |
drbd: Track the reasons to suspend IO in dedicated state bits
There are three ways to get IO suspended:
* Loss of any access to data
* Fence-peer-handler running
* User requested to suspend IO
Track those in different bits, so that one condition clearing its
state bit does not interfere with the other two conditions.
Only when the user resumes IO he overrules all three bits.
The fact is hidden from the user, he sees only a single suspend
bit.
Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
Diffstat (limited to 'drivers/block/drbd/drbd_int.h')
-rw-r--r-- | drivers/block/drbd/drbd_int.h | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/drivers/block/drbd/drbd_int.h b/drivers/block/drbd/drbd_int.h index eb1273d04caf..ff7fffa00dac 100644 --- a/drivers/block/drbd/drbd_int.h +++ b/drivers/block/drbd/drbd_int.h | |||
@@ -1681,6 +1681,8 @@ void drbd_bcast_ee(struct drbd_conf *mdev, | |||
1681 | #define susp_MASK 1 | 1681 | #define susp_MASK 1 |
1682 | #define user_isp_MASK 1 | 1682 | #define user_isp_MASK 1 |
1683 | #define aftr_isp_MASK 1 | 1683 | #define aftr_isp_MASK 1 |
1684 | #define susp_nod_MASK 1 | ||
1685 | #define susp_fen_MASK 1 | ||
1684 | 1686 | ||
1685 | #define NS(T, S) \ | 1687 | #define NS(T, S) \ |
1686 | ({ union drbd_state mask; mask.i = 0; mask.T = T##_MASK; mask; }), \ | 1688 | ({ union drbd_state mask; mask.i = 0; mask.T = T##_MASK; mask; }), \ |
@@ -2254,11 +2256,16 @@ static inline int drbd_state_is_stable(union drbd_state s) | |||
2254 | return 1; | 2256 | return 1; |
2255 | } | 2257 | } |
2256 | 2258 | ||
2259 | static inline int is_susp(union drbd_state s) | ||
2260 | { | ||
2261 | return s.susp || s.susp_nod || s.susp_fen; | ||
2262 | } | ||
2263 | |||
2257 | static inline int __inc_ap_bio_cond(struct drbd_conf *mdev) | 2264 | static inline int __inc_ap_bio_cond(struct drbd_conf *mdev) |
2258 | { | 2265 | { |
2259 | int mxb = drbd_get_max_buffers(mdev); | 2266 | int mxb = drbd_get_max_buffers(mdev); |
2260 | 2267 | ||
2261 | if (mdev->state.susp) | 2268 | if (is_susp(mdev->state)) |
2262 | return 0; | 2269 | return 0; |
2263 | if (test_bit(SUSPEND_IO, &mdev->flags)) | 2270 | if (test_bit(SUSPEND_IO, &mdev->flags)) |
2264 | return 0; | 2271 | return 0; |