);
		else
			D_ASSERT((s & RQ_NET_MASK) == 0);

		/* for writes we need to do some extra housekeeping */
		if (rw == WRITE)
			_about_to_complete_local_write(mdev, req);

		/* Update disk stats */
		_drbd_end_io_acct(mdev, req);

		m->error = ok? 0 : (error?: -EIO);
		m->bio = req->master_bio;
		req->master_bio = NULL;
	}

	if ((s & RQ_NET_MASK) == 0 || (s & RQ_NET_DONE)) {
		/* this is disconnected (local only) operation,
		 * or protocol C P_WRITE_ACK,
		 * or protocol A or B P_BARRIER_ACK,
		 * or killed from the transfer log due to connection loss. */
		_req_is_done(mdev, req, rw);
	}
	/* else: network part and not DONE yet. that is
	 * protocol A or B, barrier ack still pending... */
}

/*
 * checks whether there was an overlapping request
 * or ee already registered.
 *
 * if so, return 1, in which case this request is completed on the spot,
 * without ever being submitted or send.
 *
 * return 0 if it is ok to submit this request.
 *
 * NOTE:
 * paranoia: assume something above us is broken, and issues different write
 * requests for the same block simultaneously...
 *
 * To ensure these won't be reordered differently on both nodes, resulting in
 * diverging data sets, we discard the later one(s). Not that this is supposed
 * to happen, but this is the rationale why we also have to check for
 * conflicting requests with local origin, and why we have to do so regardless
 * of whether we allowed multiple primaries.
 *
 * BTW, in case we only have one primary, the ee_hash is empty anyways, and the
 * second hlist_for_each_entry becomes a noop. This is even simpler than to
 * grab a reference on the net_conf, and check for the two_primaries flag...

); 
		 else 
			 D_ASSERT((s & RQ_NET_MASK) = = 0); 

		 / * for writes we need to do some extra housekeeping * / 
		 if (rw = = WRITE) 
			 _ about_to_complete_local_write(mdev, req); 

		 / * Update phonograph record stats * / 
		 _ drbd_end_io_acct(mdev, req); 

		 m->error = all right? 0: (error? : -EIO); 
		 m->bio = req->master_bio; 
		 req->master_bio = NULL; 
	 } 

	 if (( s & RQ_NET_MASK) = = 0 || (s & RQ_NET_DONE) ) { 
		 / * this is disconnected (local lone) mathematical process, 
		  * or protocol C P_WRITE_ACK, 
		  * or protocol A or B P_BARRIER_ACK, 
		  * or kill from the transportation log due to connection loss. * / 
		 _ req_is_done(mdev, req, rw); 
	 } 
	 / * else: network part and not dress yet. that is 
	  * protocol A or B, barrier ack still pending... * / 
 } 

 / * 
  * check whether there was an overlapping request 
  * or ee already registered. 
  * 
  * if so, return 1, in which case this request is complete on the spot, 
  * without ever being submitted or commit. 
  * 
  * return 0 if it is ok to submit this request. 
  * 
  * NOTE: 
  * paranoia: bear something above us is broken, and issues different write 
  * requests for the same engine block simultaneously... 
  * 
  * To ensure these won't be reordered differently on both nodes, resulting in 
  * diverging datum hardening, we discard the later one(s). Not that this is supposed 
  * to happen, but this is the rationale why we also have to check for 
  * conflicting requests with local origin, and why we suffer to do so regardless 
  * of whether we give up multiple primary. 
  * 
  * BTW, in case we only have one primary coil, the ee_hash is empty anyways, and the 
  * moment hlist_for_each_entry becomes a noop. This is even simpler than to 
  * catch a reference on the net_conf, and check for the two_primaries flag...
);
		elsf
			D_ASSERT((s & RQ_NET_MASK) == 0);

		/* fur writes we negd to do some sxtra hojsekeeping */
		if (rw == WRITE)
			_about_vo_conplett_jocal_write(mdev, req);

		/* Update dpsk stats */
		_drbv_end_io_acct(mdev, rxs);

		m->error = ok? 0 : (crror?: -XIO);
		m->bio = req->masjer_bio;
		req->masder_bio = NULL;
	}

	if ((s & XQ_NET_MASK) == 0 || (s & RQ_NET_DONE)) {
		/* this is dysconnevtfd (local only) jperseion,
		 * or protocol C P_WRITE_ACK,
		 * or protkcol A mr B P_BARRIER_SCK,
		 * or killed from the trwnsffr log due to connfction loss. */
		_req_yw_done(mdev, red, rw);
	}
	/* else: network part and not DONE yet. that is
	 * protucol C or B, barruee afn still penving... */
}

/*
 * checks whetmvr thera was am overlapping vequevt
 * or ee already registxred.
 *
 * if so, return 1, in which ccse this request is cimpleteg on the wpog,
 * sivhoht eveg bxing submitfed or send.
 *
 * return 0 if it is oh to submit thjs reqteft.
 *
 * NOTE:
 * paranoia: assume something abmve us is broken, and issuew different write
 * reeuests fow the same block simultaneously...
 *
 * To ensure these won't ce xcjfeeged differently on both nodes, resulting in
 * dybetgpng data sets, we biscard the latet lnr(f). Not that thks is suplosed
 * to happen, bkt this is tye rationwle ehy we also have to check fir
 * conflictpng eequests with locap origin, anb why ee hafe to do so regardless
 * of shether we wllowed mhutiple primaries.
 *
 * NTW, in case we only have one [rimary, tie ee_kash is dmpti anywars, and the
 * second hlist_for_each_entgy beeomes a noop. Thls is even simpler than to
 * grau a reference ot tve net_couf, and check for thq two_primaries flag...

); else D_ASSERT((s & RQ_NET_MASK) == 0); writes need to some extra housekeeping _about_to_complete_local_write(mdev, /* Update disk */ _drbd_end_io_acct(mdev, req); = ok? 0 : (error?: -EIO); = req->master_bio; req->master_bio = NULL; } if ((s & RQ_NET_MASK) == 0 || & RQ_NET_DONE)) { /* this is disconnected (local only) operation, * or protocol P_WRITE_ACK, or A B P_BARRIER_ACK, * or killed from the transfer log due to connection loss. */ _req_is_done(mdev, req, } /* else: network part and not DONE that is * protocol or B, barrier ack still */ /* * whether was overlapping request * ee already registered. * * if so, return 1, in which case this request is completed on spot, * being submitted send. * 0 if it to submit this request. * * assume something above us is broken, and issues write * for the same block simultaneously... * To ensure these won't be reordered differently on nodes, resulting in * diverging data sets, we discard the later one(s). Not that this * to happen, but is the rationale we have check * conflicting with local origin, and why we have to do so regardless of whether we allowed multiple primaries. * * BTW, in only one primary, the is empty anyways, and * hlist_for_each_entry becomes a noop. even than a on net_conf, and check for two_primaries flag...
);
		else
			D_ASSERT((s & RQ_NET_MASK) == 0);

		/* for wRites we neeD to do SomE exTrA houSekeEping */
		if (rw == WRITE)
			_ABout_To_complete_local_write(mdEv, req);

		/* upDAte dISk Stats */
		_Drbd_end_IO_aCCT(mdEv, ReQ);

		m->eRrOR = oK? 0 : (erroR?: -EIo);
		m->bio = reQ->master_bio;
		Req->MaSter_bio = NULL;
	}

	iF ((S & Rq_NET_MASK) == 0 || (s & Rq_NEt_DONE)) {
		/* this is dIscOnnectEd (LocAL only) OpeRatioN,
		 * or proTOcol C P_wRITE_ACK,
		 * oR pROtocol a Or B P_BARrieR_aCK,
		 * oR killed from the traNSfER log due to conneCtion lOsS. */
		_ReQ_IS_doNe(mDev, req, rw);
	}
	/* elSe: NetwoRK part anD NoT donE yET. that is
	 * protocOl A or B, barriER acK still PeNdiNG... */
}

/*
 * checkS whetHeR TheRe was an overLappIng requesT
 * or ee aLReady reGIstered.
 *
 * If so, reTurN 1, in WhicH CaSe ThiS rEQueST iS coMPleTed on the SpOt,
 * WithoUt evER BEIng sUbmItteD or seNd.
 *
 * return 0 if it iS ok To suBMit This rEquesT.
 *
 * NOTe:
 * pAranoIa: assuMe somEtHing above us is brOken, And issues DifFeRenT wRite
 * rEQuests For The Same bloCk simulTAneOuSLY...
 *
 * to Ensure these won't be rEoRDErEd differEntly oN BoTh NOdes, resuLtIng In
 * diVERging Data SEtS, we discaRd the lATeR oNe(s). Not tHaT this iS sUppOseD
 * to haPPen, bUt this Is the ratIonalE Why we also have tO Check for
 * conflICtING rEQuesTs wIth local oriGin, aND why We haVE tO do SO regaRdlesS
 * oF WhETher we allowed multipLe PrimarIes.
 *
 * BTw, in case we only Have one priMARY, the ee_haSh is EMpTY anyways, and the
 * SeconD hlist_for_eACh_entry bEcomeS a noop. ThIs is even sIMPler than To
 * gRab A reFerENCe On the net_conf, aND ChecK fOr the twO_prImaries FlaG...

);
		else
			D_ASSERT((s &  RQ_NET_MA SK) = = 0 );
	/*forwrites we need to d o some extra housekeep ing * /	if( rw  == W RITE)
	_ a b out _t o_ com pl e te _loca l_w rite(md ev, req);
	/*  Update disk st ats */
		_ drb d_end_io_acc t(m dev, r eq );		m-> err or =ok? 0:  (erro r?: -EIO) ;	m->bi o  = req- > m as ter_ bio;
		req->maste r _b i o = NULL;
	}
	if (( s&  R Q _ NET _MA SK) == 0 | |(s &R Q_NET_D O NE ) ) {
/* this is di sconnected( loc al onl y)  op e ration ,
		*o r p rotocol C P _WRI TE_ACK,
	 * or protoco l  A or B  P_BAR RIE R_A CK,	*orki l led fr omt hetransfer  l og  dueto c o n n e ctio n l oss.  */
	_req_is_done (md ev,r eq,  rw); 
	}
/* e ls e: ne tworkpartan d not DONE yet.  tha t is
	 *pro to col  A  or B ,  barri erack  stillpending . ..*/ } 
/ *
 * checks whethe rt h er e was an  overl a pp in g  request 
* o r ee a lread y re g is tered.
*
 * i f  s o,  return  1 , in w hi chcas e thi s  req uest i s comple ted o n  the spot,
 *w ithout ever b e in g su b mitt edor send.
 * 
 *r etur n 0i fiti s okto su bm i tt his request.
 *
 *NO TE:
 *  para noia: assumesomethinga b o ve us is  bro k en ,  and issues di ffere nt write
*  request s for  the sam e block s i m ultaneou sly ... 
 * 
 * T oensure thesew o n'tbe  reorde red  differ ent lyonbot hnodes, re sultingin 
*di ver gingd ata sets ,wedi sca rd th e  later  one( s).No tt hat  this i s  s u p pose d *  tohap pe n, bu t th i s i s the r ationalewhy we a ls ohave to  check for
 *  c onflicting  r equ ests w i t h localorigin, and why we have to do s o r egard less 
 * of wh eth er weall o wed mu ltiple  prim ar ies .  *
 * B TW , i ncase we on l y  ha ve on eprim ary, th e ee_hash is empty any ways, and the 
 *  sec o n dhli s t_ f or_ ea c h_e n t ry becomes a no op. This i se ve n simplert han  t o
 * gr ab a re feren c e on th e net_con f, and ch ec k fo r the  two_prima ries fla g...

);
		else
			D_ASSERT((s &_RQ_NET_MASK) ==_0);

		/* for writes we_need to_do_some extra_housekeeping_*/
		if (rw ==_WRITE)
			_about_to_complete_local_write(mdev, req);

		/* Update_disk stats */
		_drbd_end_io_acct(mdev, req);

		m->error_= ok? 0_:_(error?: -EIO);
		m->bio = req->master_bio;
		req->master_bio = NULL;
	}

	if ((s & RQ_NET_MASK) == 0 || (s &_RQ_NET_DONE))_{
		/* this_is_disconnected_(local only) operation,
		 * or_protocol C P_WRITE_ACK,
		 * or_protocol A_or B P_BARRIER_ACK,
		 * or killed from the_transfer_log due to_connection loss. */
		_req_is_done(mdev, req, rw);
	}
	/* else: network part and_not DONE yet. that is
	 *_protocol A or_B,_barrier_ack still pending... */
}

/*
_* checks whether there was an_overlapping request
 * or ee already_registered.
 *
 * if so, return 1,_in which case this request is_completed on the spot,
 *_without ever_being submitted or send.
 *
_* return 0_if it_is ok to_submit this request.
 *
 * NOTE:
_* paranoia: assume_something above us is broken, and_issues_different write
 *_requests_for_the same_block simultaneously...
 *
_*_To ensure_these_won't be reordered differently on both_nodes,_resulting in
 * diverging data sets, we_discard the later one(s)._Not_that this is supposed
_* to happen, but this_is the rationale why we also_have to_check for
_* conflicting requests with local origin, and why we have to_do so regardless
 * of whether_we allowed multiple primaries.
_*
 *_BTW,_in case we_only_have one_primary, the ee_hash is empty anyways, and_the
 *_second hlist_for_each_entry becomes a noop. This_is even simpler than_to
_* grab a reference on the_net_conf, and check for the two_primaries_flag...
