aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLars Ellenberg <lars.ellenberg@linbit.com>2012-07-24 03:31:18 -0400
committerPhilipp Reisner <philipp.reisner@linbit.com>2012-11-08 10:58:37 -0500
commit934722a2dbf87b43d39c787441e511157d5add94 (patch)
treec41a5b34433473068596cf237176dba269af1d5f
parenta0d856dfaed16efb9600b2a7d147cb6dbc11ff94 (diff)
drbd: __req_mod: make DISCARD_WRITE and independend case
cherry-picked and adapted from drbd 9 devel branch This looks cleaner to me, and also gets rid of the other ugly if-inside-case-fall-through. 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_req.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/drivers/block/drbd/drbd_req.c b/drivers/block/drbd/drbd_req.c
index 329528d9dec7..f2ba43e78377 100644
--- a/drivers/block/drbd/drbd_req.c
+++ b/drivers/block/drbd/drbd_req.c
@@ -609,13 +609,19 @@ int __req_mod(struct drbd_request *req, enum drbd_req_event what,
609 case DISCARD_WRITE: 609 case DISCARD_WRITE:
610 /* for discarded conflicting writes of multiple primaries, 610 /* for discarded conflicting writes of multiple primaries,
611 * there is no need to keep anything in the tl, potential 611 * there is no need to keep anything in the tl, potential
612 * node crashes are covered by the activity log. */ 612 * node crashes are covered by the activity log.
613 mod_rq_state(req, NULL, 0, RQ_NET_DONE); 613 *
614 /* fall through */ 614 * If this request had been marked as RQ_POSTPONED before,
615 * it will actually not be discarded, but "restarted",
616 * resubmitted from the retry worker context. */
617 D_ASSERT(req->rq_state & RQ_NET_PENDING);
618 D_ASSERT(req->rq_state & RQ_EXP_WRITE_ACK);
619 mod_rq_state(req, m, RQ_NET_PENDING, RQ_NET_DONE|RQ_NET_OK);
620 break;
621
615 case WRITE_ACKED_BY_PEER_AND_SIS: 622 case WRITE_ACKED_BY_PEER_AND_SIS:
623 req->rq_state |= RQ_NET_SIS;
616 case WRITE_ACKED_BY_PEER: 624 case WRITE_ACKED_BY_PEER:
617 if (what == WRITE_ACKED_BY_PEER_AND_SIS)
618 req->rq_state |= RQ_NET_SIS;
619 D_ASSERT(req->rq_state & RQ_EXP_WRITE_ACK); 625 D_ASSERT(req->rq_state & RQ_EXP_WRITE_ACK);
620 /* protocol C; successfully written on peer. 626 /* protocol C; successfully written on peer.
621 * Nothing more to do here. 627 * Nothing more to do here.