Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 208285
b: refs/heads/master
c: 1396174
h: refs/heads/master
i:
  208283: ee70c9b
v: v3
  • Loading branch information
Daniel Stodden authored and Jens Axboe committed Aug 7, 2010
1 parent d697c3b commit c231797
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 8 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: b70f5fa043b318659c936d8c3c696250e6528944
refs/heads/master: 139617437aff1f0d3b57c2d7cc60e60efc8fe6c3
31 changes: 24 additions & 7 deletions trunk/drivers/block/xen-blkfront.c
Original file line number Diff line number Diff line change
Expand Up @@ -1118,16 +1118,33 @@ static int blkfront_is_ready(struct xenbus_device *dev)

static int blkif_open(struct block_device *bdev, fmode_t mode)
{
struct blkfront_info *info = bdev->bd_disk->private_data;

if (!info->xbdev)
return -ENODEV;
struct gendisk *disk = bdev->bd_disk;
struct blkfront_info *info;
int err = 0;

lock_kernel();
info->users++;
unlock_kernel();

return 0;
info = disk->private_data;
if (!info) {
/* xbdev gone */
err = -ERESTARTSYS;
goto out;
}

mutex_lock(&info->mutex);

if (!info->gd)
/* xbdev is closed */
err = -ERESTARTSYS;

mutex_unlock(&info->mutex);

if (!err)
++info->users;

unlock_kernel();
out:
return err;
}

static int blkif_release(struct gendisk *disk, fmode_t mode)
Expand Down

0 comments on commit c231797

Please sign in to comment.