Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 242265
b: refs/heads/master
c: aaa7c01
h: refs/heads/master
i:
  242263: 9c24eb3
v: v3
  • Loading branch information
Tejun Heo committed Mar 9, 2011
1 parent 8f422da commit c0879c0
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 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: 4bbde77787270e17418dd32c7eb32e42ad16cfc7
refs/heads/master: aaa7c01546d3dc944f5758f671284177131ccce3
10 changes: 6 additions & 4 deletions trunk/drivers/block/ub.c
Original file line number Diff line number Diff line change
Expand Up @@ -1788,7 +1788,8 @@ static int ub_bd_revalidate(struct gendisk *disk)
*
* The return code is bool!
*/
static int ub_bd_media_changed(struct gendisk *disk)
static unsigned int ub_bd_check_events(struct gendisk *disk,
unsigned int clearing)
{
struct ub_lun *lun = disk->private_data;

Expand All @@ -1806,18 +1807,18 @@ static int ub_bd_media_changed(struct gendisk *disk)
*/
if (ub_sync_tur(lun->udev, lun) != 0) {
lun->changed = 1;
return 1;
return DISK_EVENT_MEDIA_CHANGE;
}

return lun->changed;
return lun->changed ? DISK_EVENT_MEDIA_CHANGE : 0;
}

static const struct block_device_operations ub_bd_fops = {
.owner = THIS_MODULE,
.open = ub_bd_unlocked_open,
.release = ub_bd_release,
.ioctl = ub_bd_ioctl,
.media_changed = ub_bd_media_changed,
.check_events = ub_bd_check_events,
.revalidate_disk = ub_bd_revalidate,
};

Expand Down Expand Up @@ -2333,6 +2334,7 @@ static int ub_probe_lun(struct ub_dev *sc, int lnum)
disk->major = UB_MAJOR;
disk->first_minor = lun->id * UB_PARTS_PER_LUN;
disk->fops = &ub_bd_fops;
disk->events = DISK_EVENT_MEDIA_CHANGE;
disk->private_data = lun;
disk->driverfs_dev = &sc->intf->dev;

Expand Down

0 comments on commit c0879c0

Please sign in to comment.