]> git.baikalelectronics.ru Git - kernel.git/commit
virtio-scsi: redo allocation of target data
authorWanlong Gao <gaowanlong@cn.fujitsu.com>
Mon, 8 Apr 2013 13:31:16 +0000 (23:01 +0930)
committerRusty Russell <rusty@rustcorp.com.au>
Mon, 8 Apr 2013 13:36:47 +0000 (23:06 +0930)
commitc587baa3494c79b24109dd6d0b9233ede84cccfe
tree068f626733a03d5100f6c32a7a8bf44bd23b109a
parentb9057640450306f9ad0d31b16396a3b3c1aef313
virtio-scsi: redo allocation of target data

virtio_scsi_target_state is now empty.  We will find new uses for it in
the next few patches, so this patch does not drop it completely.

And as James suggested, we use entries target_alloc and target_destroy
in the host template to allocate and destroy the virtio_scsi_target_state
of each target, attach this struct to scsi_target->hostdata. Now
we can get at it from the sdev with scsi_target(sdev)->hostdata.
No messing around with fixed size arrays and bulk memory allocation
and no need to pass in the maximum target size as a parameter because
everything should now happen dynamically.

Cc: James Bottomley <James.Bottomley@HansenPartnership.com>
Cc: linux-scsi@vger.kernel.org
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Wanlong Gao <gaowanlong@cn.fujitsu.com>
Reviewed-by: Asias He <asias@redhat.com>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
drivers/scsi/virtio_scsi.c