Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 268375
b: refs/heads/master
c: cd654ea
h: refs/heads/master
i:
  268373: 39cb0e7
  268371: 457dc35
  268367: 898f085
v: v3
  • Loading branch information
K. Y. Srinivasan authored and Greg Kroah-Hartman committed Sep 16, 2011
1 parent 1d6bb43 commit a6e97f6
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: f810d592a29314ade8cce29f8dac858c90a50409
refs/heads/master: cd654ea1cc72aed95e871971d87c4a988924fdda
20 changes: 10 additions & 10 deletions trunk/drivers/staging/hv/storvsc_drv.c
Original file line number Diff line number Diff line change
Expand Up @@ -266,6 +266,7 @@ struct storvsc_device {
bool destroy;
bool drain_notify;
atomic_t num_outstanding_req;
struct Scsi_Host *host;

wait_queue_head_t waiting_to_drain;

Expand Down Expand Up @@ -306,7 +307,7 @@ static inline struct storvsc_device *get_out_stor_device(
{
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;
Expand All @@ -328,7 +329,7 @@ static inline struct storvsc_device *get_in_stor_device(
{
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;
Expand Down Expand Up @@ -480,8 +481,7 @@ static void storvsc_on_io_completion(struct hv_device *device,
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;

/*
Expand Down Expand Up @@ -630,7 +630,7 @@ static int storvsc_dev_remove(struct hv_device *device)
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;
Expand All @@ -652,7 +652,7 @@ static int storvsc_dev_remove(struct hv_device *device)
* 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 */
Expand Down Expand Up @@ -962,7 +962,8 @@ static unsigned int copy_to_bounce_buffer(struct scatterlist *orig_sgl,

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;

Expand Down Expand Up @@ -1338,8 +1339,6 @@ static int storvsc_probe(struct hv_device *device,
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));

Expand All @@ -1366,7 +1365,8 @@ static int storvsc_probe(struct hv_device *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);
Expand Down

0 comments on commit a6e97f6

Please sign in to comment.