diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c index 199b02452259e4758e20d17047539472cbe11bb1..b0c59ae63a2f1ce17602f32427a2d7d5f7667cf2 100644 --- a/drivers/scsi/scsi_lib.c +++ b/drivers/scsi/scsi_lib.c @@ -526,7 +526,7 @@ static void scsi_run_queue(struct request_queue *q) struct Scsi_Host *shost = sdev->host; unsigned long flags; - if (sdev->single_lun) + if (scsi_target(sdev)->single_lun) scsi_single_lun_run(sdev); spin_lock_irqsave(shost->host_lock, flags); @@ -1559,7 +1559,7 @@ static void scsi_request_fn(struct request_queue *q) if (!scsi_host_queue_ready(q, shost, sdev)) goto not_ready; - if (sdev->single_lun) { + if (scsi_target(sdev)->single_lun) { if (scsi_target(sdev)->starget_sdev_user && scsi_target(sdev)->starget_sdev_user != sdev) goto not_ready; diff --git a/drivers/scsi/scsi_scan.c b/drivers/scsi/scsi_scan.c index 7e8b2045ccfadb0985c975657b7f467e86dd81a4..ada72af0a6dd0b75d894a32b93f4ce7258dc0140 100644 --- a/drivers/scsi/scsi_scan.c +++ b/drivers/scsi/scsi_scan.c @@ -865,7 +865,7 @@ static int scsi_add_lun(struct scsi_device *sdev, unsigned char *inq_result, sdev->no_start_on_add = 1; if (*bflags & BLIST_SINGLELUN) - sdev->single_lun = 1; + scsi_target(sdev)->single_lun = 1; sdev->use_10_for_rw = 1; diff --git a/include/scsi/scsi_device.h b/include/scsi/scsi_device.h index 6c2d80b36aa1b21f0066c284a64df692e375b948..45bb12b541757a853be532809c7df2c878ad8375 100644 --- a/include/scsi/scsi_device.h +++ b/include/scsi/scsi_device.h @@ -122,9 +122,6 @@ struct scsi_device { unsigned tagged_supported:1; /* Supports SCSI-II tagged queuing */ unsigned simple_tags:1; /* simple queue tag messages are enabled */ unsigned ordered_tags:1;/* ordered queue tag messages are enabled */ - unsigned single_lun:1; /* Indicates we should only allow I/O to - * one of the luns for the device at a - * time. */ unsigned was_reset:1; /* There was a bus reset on the bus for * this device */ unsigned expecting_cc_ua:1; /* Expecting a CHECK_CONDITION/UNIT_ATTN @@ -202,6 +199,9 @@ struct scsi_target { unsigned int id; /* target id ... replace * scsi_device.id eventually */ unsigned int create:1; /* signal that it needs to be added */ + unsigned int single_lun:1; /* Indicates we should only + * allow I/O to one of the luns + * for the device at a time. */ unsigned int pdt_1f_for_no_lun; /* PDT = 0x1f */ /* means no lun present */