Skip to content

Commit c29d7d1

Browse files
bvanasschemartinkpetersen
authored andcommitted
scsi: virtio_scsi: Remove per-target data because it is no longer used
Commit b5b6e8c ("scsi: virtio_scsi: fix IO hang caused by automatic irq vector affinity") removed all virtio_scsi hostdata users. Since the SCSI host data is no longer used, also remove the host data itself. Cc: Paolo Bonzini <pbonzini@redhat.com> Cc: Christoph Hellwig <hch@lst.de> Cc: Ming Lei <ming.lei@redhat.com> Cc: Hannes Reinecke <hare@suse.de> Signed-off-by: Bart Van Assche <bvanassche@acm.org> Reviewed-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Ming Lei <ming.lei@redhat.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
1 parent 6c8d5f0 commit c29d7d1

File tree

1 file changed

+0
-52
lines changed

1 file changed

+0
-52
lines changed

drivers/scsi/virtio_scsi.c

Lines changed: 0 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -68,33 +68,6 @@ struct virtio_scsi_vq {
6868
struct virtqueue *vq;
6969
};
7070

71-
/*
72-
* Per-target queue state.
73-
*
74-
* This struct holds the data needed by the queue steering policy. When a
75-
* target is sent multiple requests, we need to drive them to the same queue so
76-
* that FIFO processing order is kept. However, if a target was idle, we can
77-
* choose a queue arbitrarily. In this case the queue is chosen according to
78-
* the current VCPU, so the driver expects the number of request queues to be
79-
* equal to the number of VCPUs. This makes it easy and fast to select the
80-
* queue, and also lets the driver optimize the IRQ affinity for the virtqueues
81-
* (each virtqueue's affinity is set to the CPU that "owns" the queue).
82-
*
83-
* tgt_seq is held to serialize reading and writing req_vq.
84-
*
85-
* Decrements of reqs are never concurrent with writes of req_vq: before the
86-
* decrement reqs will be != 0; after the decrement the virtqueue completion
87-
* routine will not use the req_vq so it can be changed by a new request.
88-
* Thus they can happen outside the tgt_seq, provided of course we make reqs
89-
* an atomic_t.
90-
*/
91-
struct virtio_scsi_target_state {
92-
seqcount_t tgt_seq;
93-
94-
/* Currently active virtqueue for requests sent to this target. */
95-
struct virtio_scsi_vq *req_vq;
96-
};
97-
9871
/* Driver instance state */
9972
struct virtio_scsi {
10073
struct virtio_device *vdev;
@@ -693,29 +666,6 @@ static int virtscsi_abort(struct scsi_cmnd *sc)
693666
return virtscsi_tmf(vscsi, cmd);
694667
}
695668

696-
static int virtscsi_target_alloc(struct scsi_target *starget)
697-
{
698-
struct Scsi_Host *sh = dev_to_shost(starget->dev.parent);
699-
struct virtio_scsi *vscsi = shost_priv(sh);
700-
701-
struct virtio_scsi_target_state *tgt =
702-
kmalloc(sizeof(*tgt), GFP_KERNEL);
703-
if (!tgt)
704-
return -ENOMEM;
705-
706-
seqcount_init(&tgt->tgt_seq);
707-
tgt->req_vq = &vscsi->req_vqs[0];
708-
709-
starget->hostdata = tgt;
710-
return 0;
711-
}
712-
713-
static void virtscsi_target_destroy(struct scsi_target *starget)
714-
{
715-
struct virtio_scsi_target_state *tgt = starget->hostdata;
716-
kfree(tgt);
717-
}
718-
719669
static int virtscsi_map_queues(struct Scsi_Host *shost)
720670
{
721671
struct virtio_scsi *vscsi = shost_priv(shost);
@@ -748,8 +698,6 @@ static struct scsi_host_template virtscsi_host_template = {
748698

749699
.dma_boundary = UINT_MAX,
750700
.use_clustering = ENABLE_CLUSTERING,
751-
.target_alloc = virtscsi_target_alloc,
752-
.target_destroy = virtscsi_target_destroy,
753701
.map_queues = virtscsi_map_queues,
754702
.track_queue_depth = 1,
755703
.force_blk_mq = 1,

0 commit comments

Comments
 (0)