scsi, iscsi: move lun_id field to iSCSI task

This is not used in the generic SCSI layer.

Fixes: 8eba104b73 ("iscsi: Fix the bug for hotplug when read IO is
running.")

Change-Id: Ie0715ea0ee5084eaf1321ba2f65f7bfa674c663a
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/393211
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
This commit is contained in:
Daniel Verkamp 2017-12-28 15:09:28 -07:00 committed by Jim Harris
parent a7de1070c3
commit 85f55b7383
3 changed files with 10 additions and 8 deletions

View File

@ -98,11 +98,7 @@ struct spdk_scsi_task {
uint8_t status;
uint8_t function; /* task mgmt function */
uint8_t response; /* task mgmt response */
/**
* Record the lun id just in case the lun is invalid,
* which will happen when hot remove the lun.
*/
int lun_id;
struct spdk_scsi_lun *lun;
struct spdk_bdev_desc *desc;
struct spdk_io_channel *ch;

View File

@ -2896,7 +2896,7 @@ int spdk_iscsi_conn_handle_queued_datain_tasks(struct spdk_iscsi_conn *conn)
assert(task->current_datain_offset <= task->scsi.transfer_len);
if (task->current_datain_offset == 0) {
task->scsi.lun = spdk_scsi_dev_get_lun(conn->dev, task->scsi.lun_id);
task->scsi.lun = spdk_scsi_dev_get_lun(conn->dev, task->lun_id);
if (task->scsi.lun == NULL) {
TAILQ_REMOVE(&conn->queued_datain_tasks, task, link);
spdk_scsi_task_process_null_lun(&task->scsi);
@ -2921,7 +2921,7 @@ int spdk_iscsi_conn_handle_queued_datain_tasks(struct spdk_iscsi_conn *conn)
task->current_datain_offset += subtask->scsi.length;
conn->data_in_cnt++;
task->scsi.lun = spdk_scsi_dev_get_lun(conn->dev, task->scsi.lun_id);
task->scsi.lun = spdk_scsi_dev_get_lun(conn->dev, task->lun_id);
if (task->scsi.lun == NULL) {
/* Remove the primary task from the list if this is the last subtask */
if (task->current_datain_offset == task->scsi.transfer_len) {
@ -3005,7 +3005,7 @@ spdk_iscsi_op_scsi(struct spdk_iscsi_conn *conn, struct spdk_iscsi_pdu *pdu)
spdk_iscsi_task_associate_pdu(task, pdu);
lun_i = spdk_islun2lun(lun);
task->scsi.lun_id = lun_i;
task->lun_id = lun_i;
dev = conn->dev;
task->scsi.lun = spdk_scsi_dev_get_lun(dev, lun_i);

View File

@ -84,6 +84,12 @@ struct spdk_iscsi_task {
uint32_t tag;
/**
* Record the lun id just in case the lun is invalid,
* which will happen when hot removing the lun.
*/
int lun_id;
TAILQ_ENTRY(spdk_iscsi_task) link;
TAILQ_HEAD(subtask_list, spdk_iscsi_task) subtask_list;