Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 242271
b: refs/heads/master
c: cafb0bf
h: refs/heads/master
i:
  242269: cfe8aa7
  242267: 98fcd51
  242263: 9c24eb3
  242255: 9ad85d6
  242239: 7dab264
v: v3
  • Loading branch information
Tejun Heo committed Mar 9, 2011
1 parent 5bf7c7e commit 066a1ca
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 9 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: 3c0d206092f50be82523dba2b0e0a02de9e6aad3
refs/heads/master: cafb0bfca1a73efd6d8a4a6a6a716e6134b96c24
11 changes: 7 additions & 4 deletions trunk/drivers/staging/hv/blkvsc_drv.c
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,8 @@ static void blkvsc_shutdown(struct device *device);

static int blkvsc_open(struct block_device *bdev, fmode_t mode);
static int blkvsc_release(struct gendisk *disk, fmode_t mode);
static int blkvsc_media_changed(struct gendisk *gd);
static unsigned int blkvsc_check_events(struct gendisk *gd,
unsigned int clearing);
static int blkvsc_revalidate_disk(struct gendisk *gd);
static int blkvsc_getgeo(struct block_device *bd, struct hd_geometry *hg);
static int blkvsc_ioctl(struct block_device *bd, fmode_t mode,
Expand Down Expand Up @@ -162,7 +163,7 @@ static const struct block_device_operations block_ops = {
.owner = THIS_MODULE,
.open = blkvsc_open,
.release = blkvsc_release,
.media_changed = blkvsc_media_changed,
.check_events = blkvsc_check_events,
.revalidate_disk = blkvsc_revalidate_disk,
.getgeo = blkvsc_getgeo,
.ioctl = blkvsc_ioctl,
Expand Down Expand Up @@ -367,6 +368,7 @@ static int blkvsc_probe(struct device *device)
else
blkdev->gd->first_minor = 0;
blkdev->gd->fops = &block_ops;
blkdev->gd->events = DISK_EVENT_MEDIA_CHANGE;
blkdev->gd->private_data = blkdev;
blkdev->gd->driverfs_dev = &(blkdev->device_ctx->device);
sprintf(blkdev->gd->disk_name, "hd%c", 'a' + devnum);
Expand Down Expand Up @@ -1352,10 +1354,11 @@ static int blkvsc_release(struct gendisk *disk, fmode_t mode)
return 0;
}

static int blkvsc_media_changed(struct gendisk *gd)
static unsigned int blkvsc_check_events(struct gendisk *gd,
unsigned int clearing)
{
DPRINT_DBG(BLKVSC_DRV, "- enter\n");
return 1;
return DISK_EVENT_MEDIA_CHANGE;
}

static int blkvsc_revalidate_disk(struct gendisk *gd)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -381,10 +381,10 @@ static int cyasblkdev_blk_ioctl(
return -ENOTTY;
}

/* Media_changed block_device opp
/* check_events block_device opp
* this one is called by kernel to confirm if the media really changed
* as we indicated by issuing check_disk_change() call */
int cyasblkdev_media_changed(struct gendisk *gd)
unsigned int cyasblkdev_check_events(struct gendisk *gd, unsigned int clearing)
{
struct cyasblkdev_blk_data *bd;

Expand All @@ -402,7 +402,7 @@ int cyasblkdev_media_changed(struct gendisk *gd)
#endif
}

/* return media change state "1" yes, 0 no */
/* return media change state - DISK_EVENT_MEDIA_CHANGE yes, 0 no */
return 0;
}

Expand Down Expand Up @@ -432,7 +432,7 @@ static struct block_device_operations cyasblkdev_bdops = {
.ioctl = cyasblkdev_blk_ioctl,
/* .getgeo = cyasblkdev_blk_getgeo, */
/* added to support media removal( real and simulated) media */
.media_changed = cyasblkdev_media_changed,
.check_events = cyasblkdev_check_events,
/* added to support media removal( real and simulated) media */
.revalidate_disk = cyasblkdev_revalidate_disk,
.owner = THIS_MODULE,
Expand Down Expand Up @@ -1090,6 +1090,7 @@ static int cyasblkdev_add_disks(int bus_num,
bd->user_disk_0->first_minor = devidx << CYASBLKDEV_SHIFT;
bd->user_disk_0->minors = 8;
bd->user_disk_0->fops = &cyasblkdev_bdops;
bd->user_disk_0->events = DISK_EVENT_MEDIA_CHANGE;
bd->user_disk_0->private_data = bd;
bd->user_disk_0->queue = bd->queue.queue;
bd->dbgprn_flags = DBGPRN_RD_RQ;
Expand Down Expand Up @@ -1190,6 +1191,7 @@ static int cyasblkdev_add_disks(int bus_num,
bd->user_disk_1->first_minor = (devidx + 1) << CYASBLKDEV_SHIFT;
bd->user_disk_1->minors = 8;
bd->user_disk_1->fops = &cyasblkdev_bdops;
bd->user_disk_0->events = DISK_EVENT_MEDIA_CHANGE;
bd->user_disk_1->private_data = bd;
bd->user_disk_1->queue = bd->queue.queue;
bd->dbgprn_flags = DBGPRN_RD_RQ;
Expand Down Expand Up @@ -1278,6 +1280,7 @@ static int cyasblkdev_add_disks(int bus_num,
(devidx + 2) << CYASBLKDEV_SHIFT;
bd->system_disk->minors = 8;
bd->system_disk->fops = &cyasblkdev_bdops;
bd->system_disk->events = DISK_EVENT_MEDIA_CHANGE;
bd->system_disk->private_data = bd;
bd->system_disk->queue = bd->queue.queue;
/* don't search for vfat
Expand Down

0 comments on commit 066a1ca

Please sign in to comment.