Commit 3a200911 authored by Tejun Heo's avatar Tejun Heo

xsysace: Convert to bdops->check_events()

Convert from ->media_changed() to ->check_events().

xsysace buffers media changed state and clears it on revalidation.  It
will behave correctly with kernel event polling.
Signed-off-by: default avatarTejun Heo <tj@kernel.org>
Acked-by: default avatarGrant Likely <grant.likely@secretlab.ca>
Cc: Jens Axboe <axboe@kernel.dk>
Cc: Kay Sievers <kay.sievers@vrfy.org>
parent aaa7c015
...@@ -867,12 +867,12 @@ static void ace_request(struct request_queue * q) ...@@ -867,12 +867,12 @@ static void ace_request(struct request_queue * q)
} }
} }
static int ace_media_changed(struct gendisk *gd) static unsigned int ace_check_events(struct gendisk *gd, unsigned int clearing)
{ {
struct ace_device *ace = gd->private_data; struct ace_device *ace = gd->private_data;
dev_dbg(ace->dev, "ace_media_changed(): %i\n", ace->media_change); dev_dbg(ace->dev, "ace_check_events(): %i\n", ace->media_change);
return ace->media_change; return ace->media_change ? DISK_EVENT_MEDIA_CHANGE : 0;
} }
static int ace_revalidate_disk(struct gendisk *gd) static int ace_revalidate_disk(struct gendisk *gd)
...@@ -953,7 +953,7 @@ static const struct block_device_operations ace_fops = { ...@@ -953,7 +953,7 @@ static const struct block_device_operations ace_fops = {
.owner = THIS_MODULE, .owner = THIS_MODULE,
.open = ace_open, .open = ace_open,
.release = ace_release, .release = ace_release,
.media_changed = ace_media_changed, .check_events = ace_check_events,
.revalidate_disk = ace_revalidate_disk, .revalidate_disk = ace_revalidate_disk,
.getgeo = ace_getgeo, .getgeo = ace_getgeo,
}; };
...@@ -1005,6 +1005,7 @@ static int __devinit ace_setup(struct ace_device *ace) ...@@ -1005,6 +1005,7 @@ static int __devinit ace_setup(struct ace_device *ace)
ace->gd->major = ace_major; ace->gd->major = ace_major;
ace->gd->first_minor = ace->id * ACE_NUM_MINORS; ace->gd->first_minor = ace->id * ACE_NUM_MINORS;
ace->gd->fops = &ace_fops; ace->gd->fops = &ace_fops;
ace->gd->events = DISK_EVENT_MEDIA_CHANGE;
ace->gd->queue = ace->queue; ace->gd->queue = ace->queue;
ace->gd->private_data = ace; ace->gd->private_data = ace;
snprintf(ace->gd->disk_name, 32, "xs%c", ace->id + 'a'); snprintf(ace->gd->disk_name, 32, "xs%c", ace->id + 'a');
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment