diff options
author | Philipp Reisner <philipp.reisner@linbit.com> | 2011-01-17 14:27:30 -0500 |
---|---|---|
committer | Philipp Reisner <philipp.reisner@linbit.com> | 2011-03-10 05:45:42 -0500 |
commit | 6a35c45f890dc18c5527ac501b308058118f20e7 (patch) | |
tree | 627c73d972af6905f2ab77131e4232c62d31a553 /drivers/block/drbd/drbd_req.h | |
parent | 2deb8336d04106f215c21ad1b029e78d12033d02 (diff) |
drbd: Ensure that an epoch contains only requests of one kind
The assert in drbd_req.c:755 forces us to have only requests of
one kind in an epoch. The two kinds we distinguish here are:
local-only or mirrored.
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_req.h')
-rw-r--r-- | drivers/block/drbd/drbd_req.h | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/drivers/block/drbd/drbd_req.h b/drivers/block/drbd/drbd_req.h index 077c47b1e9d7..32c1f2a31266 100644 --- a/drivers/block/drbd/drbd_req.h +++ b/drivers/block/drbd/drbd_req.h | |||
@@ -360,4 +360,22 @@ static inline int req_mod(struct drbd_request *req, | |||
360 | 360 | ||
361 | return rv; | 361 | return rv; |
362 | } | 362 | } |
363 | |||
364 | static inline bool drbd_should_do_remote(union drbd_state s) | ||
365 | { | ||
366 | return s.pdsk == D_UP_TO_DATE || | ||
367 | (s.pdsk >= D_INCONSISTENT && | ||
368 | s.conn >= C_WF_BITMAP_T && | ||
369 | s.conn < C_AHEAD); | ||
370 | /* Before proto 96 that was >= CONNECTED instead of >= C_WF_BITMAP_T. | ||
371 | That is equivalent since before 96 IO was frozen in the C_WF_BITMAP* | ||
372 | states. */ | ||
373 | } | ||
374 | static inline bool drbd_should_send_oos(union drbd_state s) | ||
375 | { | ||
376 | return s.conn == C_AHEAD || s.conn == C_WF_BITMAP_S; | ||
377 | /* pdsk = D_INCONSISTENT as a consequence. Protocol 96 check not necessary | ||
378 | since we enter state C_AHEAD only if proto >= 96 */ | ||
379 | } | ||
380 | |||
363 | #endif | 381 | #endif |