RECONNECT remove redundant requeue code
We first merge waitpdu and outqueue queues and then requeue the elements. iscsi_add_to_outqueue() will sort them accordingly so this is no problem. Signed-off-by: Peter Lieven <pl@kamp.de>
This commit is contained in:
@@ -288,6 +288,12 @@ try_again:
|
|||||||
goto try_again;
|
goto try_again;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
while (old_iscsi->outqueue) {
|
||||||
|
struct iscsi_pdu *pdu = old_iscsi->outqueue;
|
||||||
|
SLIST_REMOVE(&old_iscsi->outqueue, pdu);
|
||||||
|
SLIST_ADD_END(&old_iscsi->waitpdu, pdu);
|
||||||
|
}
|
||||||
|
|
||||||
while (old_iscsi->waitpdu) {
|
while (old_iscsi->waitpdu) {
|
||||||
struct iscsi_pdu *pdu = old_iscsi->waitpdu;
|
struct iscsi_pdu *pdu = old_iscsi->waitpdu;
|
||||||
|
|
||||||
@@ -296,30 +302,6 @@ try_again:
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
pdu->itt = iscsi_itt_post_increment(iscsi);
|
|
||||||
iscsi_pdu_set_itt(pdu, pdu->itt);
|
|
||||||
|
|
||||||
/* do not increase cmdsn for PDUs marked for immediate delivery
|
|
||||||
* this will result in a protocol error */
|
|
||||||
pdu->cmdsn = (pdu->outdata.data[0] & ISCSI_PDU_IMMEDIATE)?iscsi->cmdsn:iscsi->cmdsn++;
|
|
||||||
iscsi_pdu_set_cmdsn(pdu, pdu->cmdsn);
|
|
||||||
|
|
||||||
iscsi_pdu_set_expstatsn(pdu, iscsi->statsn);
|
|
||||||
iscsi->statsn++;
|
|
||||||
|
|
||||||
pdu->written = 0;
|
|
||||||
pdu->out_written = 0;
|
|
||||||
iscsi_add_to_outqueue(iscsi, pdu);
|
|
||||||
}
|
|
||||||
|
|
||||||
while (old_iscsi->outqueue) {
|
|
||||||
struct iscsi_pdu *pdu = old_iscsi->outqueue;
|
|
||||||
|
|
||||||
SLIST_REMOVE(&old_iscsi->outqueue, pdu);
|
|
||||||
if (pdu->itt == 0xffffffff) {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (pdu->flags & ISCSI_PDU_DROP_ON_RECONNECT) {
|
if (pdu->flags & ISCSI_PDU_DROP_ON_RECONNECT) {
|
||||||
/* We dont want to requeue things like DATA-OUT since these guys
|
/* We dont want to requeue things like DATA-OUT since these guys
|
||||||
* will be reissued automatically anyway once the corresponding
|
* will be reissued automatically anyway once the corresponding
|
||||||
|
|||||||
Reference in New Issue
Block a user