bool destroy;
bool drain_notify;
atomic_t num_outstanding_req;
+ struct Scsi_Host *host;
wait_queue_head_t waiting_to_drain;
{
struct storvsc_device *stor_device;
- stor_device = (struct storvsc_device *)device->ext;
+ stor_device = hv_get_drvdata(device);
if (stor_device && stor_device->destroy)
stor_device = NULL;
{
struct storvsc_device *stor_device;
- stor_device = (struct storvsc_device *)device->ext;
+ stor_device = hv_get_drvdata(device);
if (!stor_device)
goto get_in_err;
struct storvsc_device *stor_device;
struct vstor_packet *stor_pkt;
- stor_device = (struct storvsc_device *)device->ext;
-
+ stor_device = hv_get_drvdata(device);
stor_pkt = &request->vstor_packet;
/*
struct storvsc_device *stor_device;
unsigned long flags;
- stor_device = (struct storvsc_device *)device->ext;
+ stor_device = hv_get_drvdata(device);
spin_lock_irqsave(&device->channel->inbound_lock, flags);
stor_device->destroy = true;
* allow incoming packets.
*/
spin_lock_irqsave(&device->channel->inbound_lock, flags);
- device->ext = NULL;
+ hv_set_drvdata(device, NULL);
spin_unlock_irqrestore(&device->channel->inbound_lock, flags);
/* Close the channel */
static int storvsc_remove(struct hv_device *dev)
{
- struct Scsi_Host *host = dev_get_drvdata(&dev->device);
+ struct storvsc_device *stor_device = hv_get_drvdata(dev);
+ struct Scsi_Host *host = stor_device->host;
struct hv_host_device *host_dev =
(struct hv_host_device *)host->hostdata;
if (!host)
return -ENOMEM;
- dev_set_drvdata(&device->device, host);
-
host_dev = (struct hv_host_device *)host->hostdata;
memset(host_dev, 0, sizeof(struct hv_host_device));
stor_device->destroy = false;
init_waitqueue_head(&stor_device->waiting_to_drain);
stor_device->device = device;
- device->ext = stor_device;
+ stor_device->host = host;
+ hv_set_drvdata(device, stor_device);
stor_device->port_number = host->host_no;
ret = storvsc_connect_to_vsp(device, storvsc_ringbuffer_size);