Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 249444
b: refs/heads/master
c: 6b73e4c
h: refs/heads/master
v: v3
  • Loading branch information
K. Y. Srinivasan authored and Greg Kroah-Hartman committed May 11, 2011
1 parent 297ffa6 commit de896fa
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 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: c56624988dabc11ae9872159401d1fca7e597f18
refs/heads/master: 6b73e4c06d326571589eebcb78efde6182330042
14 changes: 8 additions & 6 deletions trunk/drivers/staging/hv/blkvsc_drv.c
Original file line number Diff line number Diff line change
Expand Up @@ -249,12 +249,13 @@ static int blkvsc_submit_request(struct blkvsc_request *blkvsc_req,
static int blkvsc_open(struct block_device *bdev, fmode_t mode)
{
struct block_device_context *blkdev = bdev->bd_disk->private_data;
unsigned long flags;

spin_lock(&blkdev->lock);
spin_lock_irqsave(&blkdev->lock, flags);

blkdev->users++;

spin_unlock(&blkdev->lock);
spin_unlock_irqrestore(&blkdev->lock, flags);

return 0;
}
Expand Down Expand Up @@ -616,17 +617,18 @@ static void blkvsc_shutdown(struct hv_device *dev)
static int blkvsc_release(struct gendisk *disk, fmode_t mode)
{
struct block_device_context *blkdev = disk->private_data;
unsigned long flags;

spin_lock(&blkdev->lock);
spin_lock_irqsave(&blkdev->lock, flags);
if (blkdev->users == 1) {
spin_unlock(&blkdev->lock);
spin_unlock_irqrestore(&blkdev->lock, flags);
blkvsc_do_operation(blkdev, DO_FLUSH);
spin_lock(&blkdev->lock);
spin_lock_irqsave(&blkdev->lock, flags);
}

blkdev->users--;

spin_unlock(&blkdev->lock);
spin_unlock_irqrestore(&blkdev->lock, flags);
return 0;
}

Expand Down

0 comments on commit de896fa

Please sign in to comment.