Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 268036
b: refs/heads/master
c: f6c1748
h: refs/heads/master
v: v3
  • Loading branch information
K. Y. Srinivasan authored and Greg Kroah-Hartman committed Aug 29, 2011
1 parent ad19e50 commit f97bfb7
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 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: df977d6c90632b3868055862262529007019d4ef
refs/heads/master: f6c17484eb386014ee52d9edc8b3e8263d57c640
2 changes: 1 addition & 1 deletion trunk/drivers/staging/hv/hyperv_storage.h
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@ struct storvsc_device {

/* 0 indicates the device is being destroyed */
atomic_t ref_count;

bool destroy;
bool drain_notify;
atomic_t num_outstanding_req;

Expand Down
8 changes: 7 additions & 1 deletion trunk/drivers/staging/hv/storvsc.c
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ static inline struct storvsc_device *alloc_stor_device(struct hv_device *device)
/* Set to 2 to allow both inbound and outbound traffics */
/* (ie get_out_stor_device() and get_in_stor_device()) to proceed. */
atomic_set(&stor_device->ref_count, 2);

stor_device->destroy = false;
init_waitqueue_head(&stor_device->waiting_to_drain);
stor_device->device = device;
device->ext = stor_device;
Expand Down Expand Up @@ -399,9 +399,15 @@ int storvsc_dev_add(struct hv_device *device,
int storvsc_dev_remove(struct hv_device *device)
{
struct storvsc_device *stor_device;
unsigned long flags;


stor_device = release_stor_device(device);

spin_lock_irqsave(&device->channel->inbound_lock, flags);
stor_device->destroy = true;
spin_unlock_irqrestore(&device->channel->inbound_lock, flags);

/*
* At this point, all outbound traffic should be disable. We
* only allow inbound traffic (responses) to proceed so that
Expand Down

0 comments on commit f97bfb7

Please sign in to comment.