diff options
author | Tony Battersby <tonyb@cybernetics.com> | 2007-11-12 10:00:44 -0500 |
---|---|---|
committer | James Bottomley <James.Bottomley@HansenPartnership.com> | 2008-01-11 19:22:44 -0500 |
commit | 25d7c363f2663fe399e623c9bd819258c9760bdc (patch) | |
tree | c03867708e9f66e236163e81913cdd1c516e9f12 /drivers | |
parent | f28cd7cf8f696eafe42d1632b5a306fbf784d3cd (diff) |
[SCSI] move single_lun flag from scsi_device to scsi_target
Some SCSI tape medium changers that need the BLIST_SINGLELUN flag have
the medium changer at one LUN and the tape drive at a different LUN.
The inquiry string of the tape drive may be different from that of the
medium changer. In order for single_lun to be effective, every
scsi_device under a given scsi_target must have it set. This means that
there needs to be a blacklist entry for BOTH the medium changer AND the
tape drive, which is impractical because some medium changers may be
paired with a variety of different tape drive models. It makes more
sense to put the single_lun flag in scsi_target instead of scsi_device,
which causes every device at a given target ID to inherit the single_lun
flag from one LUN. This makes it possible to blacklist just the medium
changer and not the tape drive.
Signed-off-by: Tony Battersby <tonyb@cybernetics.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/scsi/scsi_lib.c | 4 | ||||
-rw-r--r-- | drivers/scsi/scsi_scan.c | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c index 199b02452259..b0c59ae63a2f 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) | |||
526 | struct Scsi_Host *shost = sdev->host; | 526 | struct Scsi_Host *shost = sdev->host; |
527 | unsigned long flags; | 527 | unsigned long flags; |
528 | 528 | ||
529 | if (sdev->single_lun) | 529 | if (scsi_target(sdev)->single_lun) |
530 | scsi_single_lun_run(sdev); | 530 | scsi_single_lun_run(sdev); |
531 | 531 | ||
532 | spin_lock_irqsave(shost->host_lock, flags); | 532 | spin_lock_irqsave(shost->host_lock, flags); |
@@ -1559,7 +1559,7 @@ static void scsi_request_fn(struct request_queue *q) | |||
1559 | 1559 | ||
1560 | if (!scsi_host_queue_ready(q, shost, sdev)) | 1560 | if (!scsi_host_queue_ready(q, shost, sdev)) |
1561 | goto not_ready; | 1561 | goto not_ready; |
1562 | if (sdev->single_lun) { | 1562 | if (scsi_target(sdev)->single_lun) { |
1563 | if (scsi_target(sdev)->starget_sdev_user && | 1563 | if (scsi_target(sdev)->starget_sdev_user && |
1564 | scsi_target(sdev)->starget_sdev_user != sdev) | 1564 | scsi_target(sdev)->starget_sdev_user != sdev) |
1565 | goto not_ready; | 1565 | goto not_ready; |
diff --git a/drivers/scsi/scsi_scan.c b/drivers/scsi/scsi_scan.c index 7e8b2045ccfa..ada72af0a6dd 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, | |||
865 | sdev->no_start_on_add = 1; | 865 | sdev->no_start_on_add = 1; |
866 | 866 | ||
867 | if (*bflags & BLIST_SINGLELUN) | 867 | if (*bflags & BLIST_SINGLELUN) |
868 | sdev->single_lun = 1; | 868 | scsi_target(sdev)->single_lun = 1; |
869 | 869 | ||
870 | sdev->use_10_for_rw = 1; | 870 | sdev->use_10_for_rw = 1; |
871 | 871 | ||