block: unexport DISK_EVENT_MEDIA_CHANGE for legacy/fringe drivers
In-kernel disk event polling doesn't matter for legacy/fringe drivers and may lead to infinite event loop if ->check_events() implementation generates events on level condition instead of edge. Now that block layer supports suppressing exporting unlisted events, simply leaving disk->events cleared allows these drivers to keep the internal revalidation behavior intact while avoiding weird interactions with userland event handler. Signed-off-by: Tejun Heo <tj@kernel.org> Cc: Kay Sievers <kay.sievers@vrfy.org> Signed-off-by: Jens Axboe <jaxboe@fusionio.com>
This commit is contained in:
parent
91e8549bde
commit
9fd097b149
|
@ -2547,7 +2547,6 @@ static bool DAC960_RegisterBlockDevice(DAC960_Controller_T *Controller)
|
||||||
disk->major = MajorNumber;
|
disk->major = MajorNumber;
|
||||||
disk->first_minor = n << DAC960_MaxPartitionsBits;
|
disk->first_minor = n << DAC960_MaxPartitionsBits;
|
||||||
disk->fops = &DAC960_BlockDeviceOperations;
|
disk->fops = &DAC960_BlockDeviceOperations;
|
||||||
disk->events = DISK_EVENT_MEDIA_CHANGE;
|
|
||||||
}
|
}
|
||||||
/*
|
/*
|
||||||
Indicate the Block Device Registration completed successfully,
|
Indicate the Block Device Registration completed successfully,
|
||||||
|
|
|
@ -1736,7 +1736,6 @@ static int __init fd_probe_drives(void)
|
||||||
disk->major = FLOPPY_MAJOR;
|
disk->major = FLOPPY_MAJOR;
|
||||||
disk->first_minor = drive;
|
disk->first_minor = drive;
|
||||||
disk->fops = &floppy_fops;
|
disk->fops = &floppy_fops;
|
||||||
disk->events = DISK_EVENT_MEDIA_CHANGE;
|
|
||||||
sprintf(disk->disk_name, "fd%d", drive);
|
sprintf(disk->disk_name, "fd%d", drive);
|
||||||
disk->private_data = &unit[drive];
|
disk->private_data = &unit[drive];
|
||||||
set_capacity(disk, 880*2);
|
set_capacity(disk, 880*2);
|
||||||
|
|
|
@ -1964,7 +1964,6 @@ static int __init atari_floppy_init (void)
|
||||||
unit[i].disk->first_minor = i;
|
unit[i].disk->first_minor = i;
|
||||||
sprintf(unit[i].disk->disk_name, "fd%d", i);
|
sprintf(unit[i].disk->disk_name, "fd%d", i);
|
||||||
unit[i].disk->fops = &floppy_fops;
|
unit[i].disk->fops = &floppy_fops;
|
||||||
unit[i].disk->events = DISK_EVENT_MEDIA_CHANGE;
|
|
||||||
unit[i].disk->private_data = &unit[i];
|
unit[i].disk->private_data = &unit[i];
|
||||||
unit[i].disk->queue = blk_init_queue(do_fd_request,
|
unit[i].disk->queue = blk_init_queue(do_fd_request,
|
||||||
&ataflop_lock);
|
&ataflop_lock);
|
||||||
|
|
|
@ -4205,7 +4205,6 @@ static int __init floppy_init(void)
|
||||||
disks[dr]->major = FLOPPY_MAJOR;
|
disks[dr]->major = FLOPPY_MAJOR;
|
||||||
disks[dr]->first_minor = TOMINOR(dr);
|
disks[dr]->first_minor = TOMINOR(dr);
|
||||||
disks[dr]->fops = &floppy_fops;
|
disks[dr]->fops = &floppy_fops;
|
||||||
disks[dr]->events = DISK_EVENT_MEDIA_CHANGE;
|
|
||||||
sprintf(disks[dr]->disk_name, "fd%d", dr);
|
sprintf(disks[dr]->disk_name, "fd%d", dr);
|
||||||
|
|
||||||
init_timer(&motor_off_timer[dr]);
|
init_timer(&motor_off_timer[dr]);
|
||||||
|
|
|
@ -320,7 +320,6 @@ static void pcd_init_units(void)
|
||||||
disk->first_minor = unit;
|
disk->first_minor = unit;
|
||||||
strcpy(disk->disk_name, cd->name); /* umm... */
|
strcpy(disk->disk_name, cd->name); /* umm... */
|
||||||
disk->fops = &pcd_bdops;
|
disk->fops = &pcd_bdops;
|
||||||
disk->events = DISK_EVENT_MEDIA_CHANGE;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -837,7 +837,6 @@ static void pd_probe_drive(struct pd_unit *disk)
|
||||||
p->fops = &pd_fops;
|
p->fops = &pd_fops;
|
||||||
p->major = major;
|
p->major = major;
|
||||||
p->first_minor = (disk - pd) << PD_BITS;
|
p->first_minor = (disk - pd) << PD_BITS;
|
||||||
p->events = DISK_EVENT_MEDIA_CHANGE;
|
|
||||||
disk->gd = p;
|
disk->gd = p;
|
||||||
p->private_data = disk;
|
p->private_data = disk;
|
||||||
p->queue = pd_queue;
|
p->queue = pd_queue;
|
||||||
|
|
|
@ -294,7 +294,6 @@ static void __init pf_init_units(void)
|
||||||
disk->first_minor = unit;
|
disk->first_minor = unit;
|
||||||
strcpy(disk->disk_name, pf->name);
|
strcpy(disk->disk_name, pf->name);
|
||||||
disk->fops = &pf_fops;
|
disk->fops = &pf_fops;
|
||||||
disk->events = DISK_EVENT_MEDIA_CHANGE;
|
|
||||||
if (!(*drives[unit])[D_PRT])
|
if (!(*drives[unit])[D_PRT])
|
||||||
pf_drive_count++;
|
pf_drive_count++;
|
||||||
}
|
}
|
||||||
|
|
|
@ -858,7 +858,6 @@ static int __devinit swim_floppy_init(struct swim_priv *swd)
|
||||||
swd->unit[drive].disk->first_minor = drive;
|
swd->unit[drive].disk->first_minor = drive;
|
||||||
sprintf(swd->unit[drive].disk->disk_name, "fd%d", drive);
|
sprintf(swd->unit[drive].disk->disk_name, "fd%d", drive);
|
||||||
swd->unit[drive].disk->fops = &floppy_fops;
|
swd->unit[drive].disk->fops = &floppy_fops;
|
||||||
swd->unit[drive].disk->events = DISK_EVENT_MEDIA_CHANGE;
|
|
||||||
swd->unit[drive].disk->private_data = &swd->unit[drive];
|
swd->unit[drive].disk->private_data = &swd->unit[drive];
|
||||||
swd->unit[drive].disk->queue = swd->queue;
|
swd->unit[drive].disk->queue = swd->queue;
|
||||||
set_capacity(swd->unit[drive].disk, 2880);
|
set_capacity(swd->unit[drive].disk, 2880);
|
||||||
|
|
|
@ -1163,7 +1163,6 @@ static int __devinit swim3_attach(struct macio_dev *mdev, const struct of_device
|
||||||
disk->major = FLOPPY_MAJOR;
|
disk->major = FLOPPY_MAJOR;
|
||||||
disk->first_minor = i;
|
disk->first_minor = i;
|
||||||
disk->fops = &floppy_fops;
|
disk->fops = &floppy_fops;
|
||||||
disk->events = DISK_EVENT_MEDIA_CHANGE;
|
|
||||||
disk->private_data = &floppy_states[i];
|
disk->private_data = &floppy_states[i];
|
||||||
disk->queue = swim3_queue;
|
disk->queue = swim3_queue;
|
||||||
disk->flags |= GENHD_FL_REMOVABLE;
|
disk->flags |= GENHD_FL_REMOVABLE;
|
||||||
|
|
|
@ -2334,7 +2334,6 @@ static int ub_probe_lun(struct ub_dev *sc, int lnum)
|
||||||
disk->major = UB_MAJOR;
|
disk->major = UB_MAJOR;
|
||||||
disk->first_minor = lun->id * UB_PARTS_PER_LUN;
|
disk->first_minor = lun->id * UB_PARTS_PER_LUN;
|
||||||
disk->fops = &ub_bd_fops;
|
disk->fops = &ub_bd_fops;
|
||||||
disk->events = DISK_EVENT_MEDIA_CHANGE;
|
|
||||||
disk->private_data = lun;
|
disk->private_data = lun;
|
||||||
disk->driverfs_dev = &sc->intf->dev;
|
disk->driverfs_dev = &sc->intf->dev;
|
||||||
|
|
||||||
|
|
|
@ -1005,7 +1005,6 @@ 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');
|
||||||
|
|
|
@ -803,7 +803,6 @@ static int __devinit probe_gdrom(struct platform_device *devptr)
|
||||||
goto probe_fail_cdrom_register;
|
goto probe_fail_cdrom_register;
|
||||||
}
|
}
|
||||||
gd.disk->fops = &gdrom_bdops;
|
gd.disk->fops = &gdrom_bdops;
|
||||||
gd.disk->events = DISK_EVENT_MEDIA_CHANGE;
|
|
||||||
/* latch on to the interrupt */
|
/* latch on to the interrupt */
|
||||||
err = gdrom_set_interrupt_handlers();
|
err = gdrom_set_interrupt_handlers();
|
||||||
if (err)
|
if (err)
|
||||||
|
|
|
@ -626,7 +626,6 @@ static int viocd_probe(struct vio_dev *vdev, const struct vio_device_id *id)
|
||||||
gendisk->queue = q;
|
gendisk->queue = q;
|
||||||
gendisk->fops = &viocd_fops;
|
gendisk->fops = &viocd_fops;
|
||||||
gendisk->flags = GENHD_FL_CD|GENHD_FL_REMOVABLE;
|
gendisk->flags = GENHD_FL_CD|GENHD_FL_REMOVABLE;
|
||||||
gendisk->events = DISK_EVENT_MEDIA_CHANGE;
|
|
||||||
set_capacity(gendisk, 0);
|
set_capacity(gendisk, 0);
|
||||||
gendisk->private_data = d;
|
gendisk->private_data = d;
|
||||||
d->viocd_disk = gendisk;
|
d->viocd_disk = gendisk;
|
||||||
|
|
|
@ -1000,7 +1000,6 @@ static struct i2o_block_device *i2o_block_device_alloc(void)
|
||||||
gd->major = I2O_MAJOR;
|
gd->major = I2O_MAJOR;
|
||||||
gd->queue = queue;
|
gd->queue = queue;
|
||||||
gd->fops = &i2o_block_fops;
|
gd->fops = &i2o_block_fops;
|
||||||
gd->events = DISK_EVENT_MEDIA_CHANGE;
|
|
||||||
gd->private_data = dev;
|
gd->private_data = dev;
|
||||||
|
|
||||||
dev->gd = gd;
|
dev->gd = gd;
|
||||||
|
|
|
@ -236,7 +236,6 @@ tapeblock_setup_device(struct tape_device * device)
|
||||||
disk->major = tapeblock_major;
|
disk->major = tapeblock_major;
|
||||||
disk->first_minor = device->first_minor;
|
disk->first_minor = device->first_minor;
|
||||||
disk->fops = &tapeblock_fops;
|
disk->fops = &tapeblock_fops;
|
||||||
disk->events = DISK_EVENT_MEDIA_CHANGE;
|
|
||||||
disk->private_data = tape_get_device(device);
|
disk->private_data = tape_get_device(device);
|
||||||
disk->queue = blkdat->request_queue;
|
disk->queue = blkdat->request_queue;
|
||||||
set_capacity(disk, 0);
|
set_capacity(disk, 0);
|
||||||
|
|
Loading…
Reference in New Issue