Commit 8c22eb3a authored by Christoph Hellwig's avatar Christoph Hellwig Committed by Jens Axboe

cdrom: remove the unused cdrom_media_changed function

As well as the ->media_changed method.  All these are left over from
before the drivers were switched over to the check_events scheme.
Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
parent a564e23f
...@@ -157,7 +157,6 @@ with the kernel as a block device by registering the following general ...@@ -157,7 +157,6 @@ with the kernel as a block device by registering the following general
cdrom_release, /∗ release ∗/ cdrom_release, /∗ release ∗/
NULL, /∗ fsync ∗/ NULL, /∗ fsync ∗/
NULL, /∗ fasync ∗/ NULL, /∗ fasync ∗/
cdrom_media_changed, /∗ media change ∗/
NULL /∗ revalidate ∗/ NULL /∗ revalidate ∗/
}; };
...@@ -366,19 +365,6 @@ which may or may not be in the drive). If the drive is not a changer, ...@@ -366,19 +365,6 @@ which may or may not be in the drive). If the drive is not a changer,
CDS_DRIVE_NOT_READY /* something is wrong, tray is moving? */ CDS_DRIVE_NOT_READY /* something is wrong, tray is moving? */
CDS_DISC_OK /* a disc is loaded and everything is fine */ CDS_DISC_OK /* a disc is loaded and everything is fine */
::
int media_changed(struct cdrom_device_info *cdi, int disc_nr)
This function is very similar to the original function in $struct
file_operations*. It returns 1 if the medium of the device *cdi->dev*
has changed since the last call, and 0 otherwise. The parameter
*disc_nr* identifies a specific slot in a juke-box, it should be
ignored for single-disc drives. Note that by `re-routing` this
function through *cdrom_media_changed()*, we can implement separate
queues for the VFS and a new *ioctl()* function that can report device
changes to software (e. g., an auto-mounting daemon).
:: ::
int tray_move(struct cdrom_device_info *cdi, int position) int tray_move(struct cdrom_device_info *cdi, int position)
...@@ -917,9 +903,7 @@ commands can be identified by the underscores in their names. ...@@ -917,9 +903,7 @@ commands can be identified by the underscores in their names.
maximum number of discs in the juke-box found in the *cdrom_dops*. maximum number of discs in the juke-box found in the *cdrom_dops*.
`CDROM_MEDIA_CHANGED` `CDROM_MEDIA_CHANGED`
Returns 1 if a disc has been changed since the last call. Returns 1 if a disc has been changed since the last call.
Note that calls to *cdrom_media_changed* by the VFS are treated For juke-boxes, an extra argument *arg*
by an independent queue, so both mechanisms will detect a
media change once. For juke-boxes, an extra argument *arg*
specifies the slot for which the information is given. The special specifies the slot for which the information is given. The special
value *CDSL_CURRENT* requests that information about the currently value *CDSL_CURRENT* requests that information about the currently
selected slot be returned. selected slot be returned.
......
...@@ -605,7 +605,7 @@ int register_cdrom(struct gendisk *disk, struct cdrom_device_info *cdi) ...@@ -605,7 +605,7 @@ int register_cdrom(struct gendisk *disk, struct cdrom_device_info *cdi)
disk->cdi = cdi; disk->cdi = cdi;
ENSURE(cdo, drive_status, CDC_DRIVE_STATUS); ENSURE(cdo, drive_status, CDC_DRIVE_STATUS);
if (cdo->check_events == NULL && cdo->media_changed == NULL) if (cdo->check_events == NULL)
WARN_ON_ONCE(cdo->capability & (CDC_MEDIA_CHANGED | CDC_SELECT_DISC)); WARN_ON_ONCE(cdo->capability & (CDC_MEDIA_CHANGED | CDC_SELECT_DISC));
ENSURE(cdo, tray_move, CDC_CLOSE_TRAY | CDC_OPEN_TRAY); ENSURE(cdo, tray_move, CDC_CLOSE_TRAY | CDC_OPEN_TRAY);
ENSURE(cdo, lock_door, CDC_LOCK); ENSURE(cdo, lock_door, CDC_LOCK);
...@@ -1419,8 +1419,6 @@ static int cdrom_select_disc(struct cdrom_device_info *cdi, int slot) ...@@ -1419,8 +1419,6 @@ static int cdrom_select_disc(struct cdrom_device_info *cdi, int slot)
if (cdi->ops->check_events) if (cdi->ops->check_events)
cdi->ops->check_events(cdi, 0, slot); cdi->ops->check_events(cdi, 0, slot);
else
cdi->ops->media_changed(cdi, slot);
if (slot == CDSL_NONE) { if (slot == CDSL_NONE) {
/* set media changed bits, on both queues */ /* set media changed bits, on both queues */
...@@ -1517,13 +1515,10 @@ int media_changed(struct cdrom_device_info *cdi, int queue) ...@@ -1517,13 +1515,10 @@ int media_changed(struct cdrom_device_info *cdi, int queue)
return ret; return ret;
/* changed since last call? */ /* changed since last call? */
if (cdi->ops->check_events) { BUG_ON(!queue); /* shouldn't be called from VFS path */
BUG_ON(!queue); /* shouldn't be called from VFS path */ cdrom_update_events(cdi, DISK_EVENT_MEDIA_CHANGE);
cdrom_update_events(cdi, DISK_EVENT_MEDIA_CHANGE); changed = cdi->ioctl_events & DISK_EVENT_MEDIA_CHANGE;
changed = cdi->ioctl_events & DISK_EVENT_MEDIA_CHANGE; cdi->ioctl_events = 0;
cdi->ioctl_events = 0;
} else
changed = cdi->ops->media_changed(cdi, CDSL_CURRENT);
if (changed) { if (changed) {
cdi->mc_flags = 0x3; /* set bit on both queues */ cdi->mc_flags = 0x3; /* set bit on both queues */
...@@ -1535,18 +1530,6 @@ int media_changed(struct cdrom_device_info *cdi, int queue) ...@@ -1535,18 +1530,6 @@ int media_changed(struct cdrom_device_info *cdi, int queue)
return ret; return ret;
} }
int cdrom_media_changed(struct cdrom_device_info *cdi)
{
/* This talks to the VFS, which doesn't like errors - just 1 or 0.
* Returning "0" is always safe (media hasn't been changed). Do that
* if the low-level cdrom driver dosn't support media changed. */
if (cdi == NULL || cdi->ops->media_changed == NULL)
return 0;
if (!CDROM_CAN(CDC_MEDIA_CHANGED))
return 0;
return media_changed(cdi, 0);
}
/* Requests to the low-level drivers will /always/ be done in the /* Requests to the low-level drivers will /always/ be done in the
following format convention: following format convention:
...@@ -3464,7 +3447,6 @@ EXPORT_SYMBOL(unregister_cdrom); ...@@ -3464,7 +3447,6 @@ EXPORT_SYMBOL(unregister_cdrom);
EXPORT_SYMBOL(cdrom_open); EXPORT_SYMBOL(cdrom_open);
EXPORT_SYMBOL(cdrom_release); EXPORT_SYMBOL(cdrom_release);
EXPORT_SYMBOL(cdrom_ioctl); EXPORT_SYMBOL(cdrom_ioctl);
EXPORT_SYMBOL(cdrom_media_changed);
EXPORT_SYMBOL(cdrom_number_of_slots); EXPORT_SYMBOL(cdrom_number_of_slots);
EXPORT_SYMBOL(cdrom_mode_select); EXPORT_SYMBOL(cdrom_mode_select);
EXPORT_SYMBOL(cdrom_mode_sense); EXPORT_SYMBOL(cdrom_mode_sense);
......
...@@ -73,7 +73,6 @@ struct cdrom_device_ops { ...@@ -73,7 +73,6 @@ struct cdrom_device_ops {
int (*drive_status) (struct cdrom_device_info *, int); int (*drive_status) (struct cdrom_device_info *, int);
unsigned int (*check_events) (struct cdrom_device_info *cdi, unsigned int (*check_events) (struct cdrom_device_info *cdi,
unsigned int clearing, int slot); unsigned int clearing, int slot);
int (*media_changed) (struct cdrom_device_info *, int);
int (*tray_move) (struct cdrom_device_info *, int); int (*tray_move) (struct cdrom_device_info *, int);
int (*lock_door) (struct cdrom_device_info *, int); int (*lock_door) (struct cdrom_device_info *, int);
int (*select_speed) (struct cdrom_device_info *, int); int (*select_speed) (struct cdrom_device_info *, int);
...@@ -107,7 +106,6 @@ extern int cdrom_ioctl(struct cdrom_device_info *cdi, struct block_device *bdev, ...@@ -107,7 +106,6 @@ extern int cdrom_ioctl(struct cdrom_device_info *cdi, struct block_device *bdev,
fmode_t mode, unsigned int cmd, unsigned long arg); fmode_t mode, unsigned int cmd, unsigned long arg);
extern unsigned int cdrom_check_events(struct cdrom_device_info *cdi, extern unsigned int cdrom_check_events(struct cdrom_device_info *cdi,
unsigned int clearing); unsigned int clearing);
extern int cdrom_media_changed(struct cdrom_device_info *);
extern int register_cdrom(struct gendisk *disk, struct cdrom_device_info *cdi); extern int register_cdrom(struct gendisk *disk, struct cdrom_device_info *cdi);
extern void unregister_cdrom(struct cdrom_device_info *cdi); extern void unregister_cdrom(struct cdrom_device_info *cdi);
......
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