From 49af416f477630f5d2e63b0c13af47953e6e9982 Mon Sep 17 00:00:00 2001 From: Ronnie Sahlberg Date: Sun, 11 Nov 2012 09:35:34 -0800 Subject: [PATCH] When we cancel a scsi task we don't need to unlink the in_buffers We dont need to unlink the in-buffers when cancelling a scsi task since the whole task structure will go away shortly anyway and all entries in the link will be automatically freed when the task is freed. --- lib/scsi-lowlevel.c | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/lib/scsi-lowlevel.c b/lib/scsi-lowlevel.c index 45d516e..e7e6da5 100644 --- a/lib/scsi-lowlevel.c +++ b/lib/scsi-lowlevel.c @@ -2566,10 +2566,6 @@ iscsi_scsi_task_cancel(struct iscsi_context *iscsi, for (pdu = iscsi->waitpdu; pdu; pdu = pdu->next) { if (pdu->itt == task->itt) { - while(task->in_buffers != NULL) { - struct scsi_data_buffer *ptr = task->in_buffers; - SLIST_REMOVE(&task->in_buffers, ptr); - } SLIST_REMOVE(&iscsi->waitpdu, pdu); if ( !(pdu->flags & ISCSI_PDU_NO_CALLBACK)) { pdu->callback(iscsi, SCSI_STATUS_CANCELLED, NULL, @@ -2581,10 +2577,6 @@ iscsi_scsi_task_cancel(struct iscsi_context *iscsi, } for (pdu = iscsi->outqueue; pdu; pdu = pdu->next) { if (pdu->itt == task->itt) { - while(task->in_buffers != NULL) { - struct scsi_data_buffer *ptr = task->in_buffers; - SLIST_REMOVE(&task->in_buffers, ptr); - } SLIST_REMOVE(&iscsi->outqueue, pdu); if ( !(pdu->flags & ISCSI_PDU_NO_CALLBACK)) { pdu->callback(iscsi, SCSI_STATUS_CANCELLED, NULL, @@ -2605,10 +2597,6 @@ iscsi_scsi_cancel_all_tasks(struct iscsi_context *iscsi) for (pdu = iscsi->waitpdu; pdu; pdu = pdu->next) { struct scsi_task *task = iscsi_scsi_get_task_from_pdu(pdu); - while(task->in_buffers != NULL) { - struct scsi_data_buffer *ptr = task->in_buffers; - SLIST_REMOVE(&task->in_buffers, ptr); - } SLIST_REMOVE(&iscsi->waitpdu, pdu); if ( !(pdu->flags & ISCSI_PDU_NO_CALLBACK)) { pdu->callback(iscsi, SCSI_STATUS_CANCELLED, NULL, @@ -2619,10 +2607,6 @@ iscsi_scsi_cancel_all_tasks(struct iscsi_context *iscsi) for (pdu = iscsi->outqueue; pdu; pdu = pdu->next) { struct scsi_task *task = iscsi_scsi_get_task_from_pdu(pdu); - while(task->in_buffers != NULL) { - struct scsi_data_buffer *ptr = task->in_buffers; - SLIST_REMOVE(&task->in_buffers, ptr); - } SLIST_REMOVE(&iscsi->outqueue, pdu); if ( !(pdu->flags & ISCSI_PDU_NO_CALLBACK)) { pdu->callback(iscsi, SCSI_STATUS_CANCELLED, NULL,