Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 934722a2 authored by Lars Ellenberg's avatar Lars Ellenberg Committed by Philipp Reisner
Browse files

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: default avatarPhilipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: default avatarLars Ellenberg <lars.ellenberg@linbit.com>
parent a0d856df
Loading
Loading
Loading
Loading
+11 −5
Original line number Original line Diff line number Diff line
@@ -609,13 +609,19 @@ int __req_mod(struct drbd_request *req, enum drbd_req_event what,
	case DISCARD_WRITE:
	case DISCARD_WRITE:
		/* for discarded conflicting writes of multiple primaries,
		/* for discarded conflicting writes of multiple primaries,
		 * there is no need to keep anything in the tl, potential
		 * there is no need to keep anything in the tl, potential
		 * node crashes are covered by the activity log. */
		 * node crashes are covered by the activity log.
		mod_rq_state(req, NULL, 0, RQ_NET_DONE);
		 *
		/* fall through */
		 * If this request had been marked as RQ_POSTPONED before,
		 * it will actually not be discarded, but "restarted",
		 * resubmitted from the retry worker context. */
		D_ASSERT(req->rq_state & RQ_NET_PENDING);
		D_ASSERT(req->rq_state & RQ_EXP_WRITE_ACK);
		mod_rq_state(req, m, RQ_NET_PENDING, RQ_NET_DONE|RQ_NET_OK);
		break;

	case WRITE_ACKED_BY_PEER_AND_SIS:
	case WRITE_ACKED_BY_PEER_AND_SIS:
	case WRITE_ACKED_BY_PEER:
		if (what == WRITE_ACKED_BY_PEER_AND_SIS)
		req->rq_state |= RQ_NET_SIS;
		req->rq_state |= RQ_NET_SIS;
	case WRITE_ACKED_BY_PEER:
		D_ASSERT(req->rq_state & RQ_EXP_WRITE_ACK);
		D_ASSERT(req->rq_state & RQ_EXP_WRITE_ACK);
		/* protocol C; successfully written on peer.
		/* protocol C; successfully written on peer.
		 * Nothing more to do here.
		 * Nothing more to do here.