change dont automatically free the scsi_task once the callback completes.

Freeing the scsi_task structure is the responsibility of the application
to either do so during the callback, or later.
This commit is contained in:
Ronnie Sahlberg
2011-03-27 17:53:05 +11:00
parent 4e6e39ee23
commit f4f6ef5033
7 changed files with 51 additions and 21 deletions

View File

@@ -38,23 +38,11 @@ iscsi_free_scsi_cbdata(struct iscsi_scsi_cbdata *scsi_cbdata)
return;
}
if (scsi_cbdata->task != NULL) {
scsi_free_scsi_task(scsi_cbdata->task);
scsi_cbdata->task = NULL;
}
free(scsi_cbdata);
}
void
iscsi_cbdata_steal_scsi_task(struct scsi_task *task)
{
struct iscsi_scsi_cbdata *scsi_cbdata =
scsi_get_task_private_ptr(task);
if (scsi_cbdata != NULL) {
scsi_cbdata->task = NULL;
}
}
static void
iscsi_scsi_response_cb(struct iscsi_context *iscsi, int status,
void *command_data, void *private_data)