pdu: drop ISCSI_PDU_NO_CALLBACK

we use the flag ISCSI_PDU_NO_CALLBACK and pdu->callback simultaneously, but
check only for one of them in various places. So drop ISCSI_PDU_NO_CALLBACK
and check for pdu->callback != NULL instead.

All PDUs that carried this flag have pdu->callback set to NULL.

Signed-off-by: Peter Lieven <pl@kamp.de>
This commit is contained in:
Peter Lieven
2016-05-02 10:40:15 +02:00
parent 03fe4d73f7
commit cde2043891
5 changed files with 22 additions and 28 deletions

View File

@@ -270,25 +270,23 @@ void iscsi_defer_reconnect(struct iscsi_context *iscsi)
while ((pdu = iscsi->outqueue)) {
ISCSI_LIST_REMOVE(&iscsi->outqueue, pdu);
if ( !(pdu->flags & ISCSI_PDU_NO_CALLBACK)) {
if (iscsi->is_loggedin && pdu->callback) {
/* If an error happened during connect/login,
we don't want to call any of the callbacks.
*/
if (iscsi->is_loggedin) {
pdu->callback(iscsi, SCSI_STATUS_CANCELLED,
NULL, pdu->private_data);
}
pdu->callback(iscsi, SCSI_STATUS_CANCELLED,
NULL, pdu->private_data);
}
iscsi_free_pdu(iscsi, pdu);
}
while ((pdu = iscsi->waitpdu)) {
ISCSI_LIST_REMOVE(&iscsi->waitpdu, pdu);
/* If an error happened during connect/login,
we don't want to call any of the callbacks.
*/
if (iscsi->is_loggedin) {
if (iscsi->is_loggedin && pdu->callback) {
/* If an error happened during connect/login,
we don't want to call any of the callbacks.
*/
pdu->callback(iscsi, SCSI_STATUS_CANCELLED,
NULL, pdu->private_data);
NULL, pdu->private_data);
}
iscsi_free_pdu(iscsi, pdu);
}