aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/cdrom
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/cdrom')
-rw-r--r--drivers/cdrom/cdrom.c23
-rw-r--r--drivers/cdrom/gdrom.c14
-rw-r--r--drivers/cdrom/viocd.c21
3 files changed, 29 insertions, 29 deletions
diff --git a/drivers/cdrom/cdrom.c b/drivers/cdrom/cdrom.c
index d47f2f80accd..d16b02423d61 100644
--- a/drivers/cdrom/cdrom.c
+++ b/drivers/cdrom/cdrom.c
@@ -973,7 +973,7 @@ static int cdrom_close_write(struct cdrom_device_info *cdi)
973 * is in their own interest: device control becomes a lot easier 973 * is in their own interest: device control becomes a lot easier
974 * this way. 974 * this way.
975 */ 975 */
976int cdrom_open(struct cdrom_device_info *cdi, struct inode *ip, struct file *fp) 976int cdrom_open(struct cdrom_device_info *cdi, struct block_device *bdev, fmode_t mode)
977{ 977{
978 int ret; 978 int ret;
979 979
@@ -982,14 +982,14 @@ int cdrom_open(struct cdrom_device_info *cdi, struct inode *ip, struct file *fp)
982 /* if this was a O_NONBLOCK open and we should honor the flags, 982 /* if this was a O_NONBLOCK open and we should honor the flags,
983 * do a quick open without drive/disc integrity checks. */ 983 * do a quick open without drive/disc integrity checks. */
984 cdi->use_count++; 984 cdi->use_count++;
985 if ((fp->f_flags & O_NONBLOCK) && (cdi->options & CDO_USE_FFLAGS)) { 985 if ((mode & FMODE_NDELAY) && (cdi->options & CDO_USE_FFLAGS)) {
986 ret = cdi->ops->open(cdi, 1); 986 ret = cdi->ops->open(cdi, 1);
987 } else { 987 } else {
988 ret = open_for_data(cdi); 988 ret = open_for_data(cdi);
989 if (ret) 989 if (ret)
990 goto err; 990 goto err;
991 cdrom_mmc3_profile(cdi); 991 cdrom_mmc3_profile(cdi);
992 if (fp->f_mode & FMODE_WRITE) { 992 if (mode & FMODE_WRITE) {
993 ret = -EROFS; 993 ret = -EROFS;
994 if (cdrom_open_write(cdi)) 994 if (cdrom_open_write(cdi))
995 goto err_release; 995 goto err_release;
@@ -1007,7 +1007,7 @@ int cdrom_open(struct cdrom_device_info *cdi, struct inode *ip, struct file *fp)
1007 cdi->name, cdi->use_count); 1007 cdi->name, cdi->use_count);
1008 /* Do this on open. Don't wait for mount, because they might 1008 /* Do this on open. Don't wait for mount, because they might
1009 not be mounting, but opening with O_NONBLOCK */ 1009 not be mounting, but opening with O_NONBLOCK */
1010 check_disk_change(ip->i_bdev); 1010 check_disk_change(bdev);
1011 return 0; 1011 return 0;
1012err_release: 1012err_release:
1013 if (CDROM_CAN(CDC_LOCK) && cdi->options & CDO_LOCK) { 1013 if (CDROM_CAN(CDC_LOCK) && cdi->options & CDO_LOCK) {
@@ -1184,7 +1184,7 @@ static int check_for_audio_disc(struct cdrom_device_info * cdi,
1184 return 0; 1184 return 0;
1185} 1185}
1186 1186
1187int cdrom_release(struct cdrom_device_info *cdi, struct file *fp) 1187void cdrom_release(struct cdrom_device_info *cdi, fmode_t mode)
1188{ 1188{
1189 struct cdrom_device_ops *cdo = cdi->ops; 1189 struct cdrom_device_ops *cdo = cdi->ops;
1190 int opened_for_data; 1190 int opened_for_data;
@@ -1205,7 +1205,7 @@ int cdrom_release(struct cdrom_device_info *cdi, struct file *fp)
1205 } 1205 }
1206 1206
1207 opened_for_data = !(cdi->options & CDO_USE_FFLAGS) || 1207 opened_for_data = !(cdi->options & CDO_USE_FFLAGS) ||
1208 !(fp && fp->f_flags & O_NONBLOCK); 1208 !(mode & FMODE_NDELAY);
1209 1209
1210 /* 1210 /*
1211 * flush cache on last write release 1211 * flush cache on last write release
@@ -1219,7 +1219,6 @@ int cdrom_release(struct cdrom_device_info *cdi, struct file *fp)
1219 cdi->options & CDO_AUTO_EJECT && CDROM_CAN(CDC_OPEN_TRAY)) 1219 cdi->options & CDO_AUTO_EJECT && CDROM_CAN(CDC_OPEN_TRAY))
1220 cdo->tray_move(cdi, 1); 1220 cdo->tray_move(cdi, 1);
1221 } 1221 }
1222 return 0;
1223} 1222}
1224 1223
1225static int cdrom_read_mech_status(struct cdrom_device_info *cdi, 1224static int cdrom_read_mech_status(struct cdrom_device_info *cdi,
@@ -2662,17 +2661,17 @@ static int cdrom_ioctl_audioctl(struct cdrom_device_info *cdi,
2662 * these days. 2661 * these days.
2663 * ATAPI / SCSI specific code now mainly resides in mmc_ioctl(). 2662 * ATAPI / SCSI specific code now mainly resides in mmc_ioctl().
2664 */ 2663 */
2665int cdrom_ioctl(struct file * file, struct cdrom_device_info *cdi, 2664int cdrom_ioctl(struct cdrom_device_info *cdi, struct block_device *bdev,
2666 struct inode *ip, unsigned int cmd, unsigned long arg) 2665 fmode_t mode, unsigned int cmd, unsigned long arg)
2667{ 2666{
2668 void __user *argp = (void __user *)arg; 2667 void __user *argp = (void __user *)arg;
2669 int ret; 2668 int ret;
2670 struct gendisk *disk = ip->i_bdev->bd_disk; 2669 struct gendisk *disk = bdev->bd_disk;
2671 2670
2672 /* 2671 /*
2673 * Try the generic SCSI command ioctl's first. 2672 * Try the generic SCSI command ioctl's first.
2674 */ 2673 */
2675 ret = scsi_cmd_ioctl(file, disk->queue, disk, cmd, argp); 2674 ret = scsi_cmd_ioctl(disk->queue, disk, mode, cmd, argp);
2676 if (ret != -ENOTTY) 2675 if (ret != -ENOTTY)
2677 return ret; 2676 return ret;
2678 2677
@@ -2696,7 +2695,7 @@ int cdrom_ioctl(struct file * file, struct cdrom_device_info *cdi,
2696 case CDROM_SELECT_DISC: 2695 case CDROM_SELECT_DISC:
2697 return cdrom_ioctl_select_disc(cdi, arg); 2696 return cdrom_ioctl_select_disc(cdi, arg);
2698 case CDROMRESET: 2697 case CDROMRESET:
2699 return cdrom_ioctl_reset(cdi, ip->i_bdev); 2698 return cdrom_ioctl_reset(cdi, bdev);
2700 case CDROM_LOCKDOOR: 2699 case CDROM_LOCKDOOR:
2701 return cdrom_ioctl_lock_door(cdi, arg); 2700 return cdrom_ioctl_lock_door(cdi, arg);
2702 case CDROM_DEBUG: 2701 case CDROM_DEBUG:
diff --git a/drivers/cdrom/gdrom.c b/drivers/cdrom/gdrom.c
index d6ba77a2dd7b..9aaa86b232b1 100644
--- a/drivers/cdrom/gdrom.c
+++ b/drivers/cdrom/gdrom.c
@@ -490,14 +490,14 @@ static struct cdrom_device_ops gdrom_ops = {
490 .n_minors = 1, 490 .n_minors = 1,
491}; 491};
492 492
493static int gdrom_bdops_open(struct inode *inode, struct file *file) 493static int gdrom_bdops_open(struct block_device *bdev, fmode_t mode)
494{ 494{
495 return cdrom_open(gd.cd_info, inode, file); 495 return cdrom_open(gd.cd_info, bdev, mode);
496} 496}
497 497
498static int gdrom_bdops_release(struct inode *inode, struct file *file) 498static int gdrom_bdops_release(struct block_device *bdev, fmode_t mode)
499{ 499{
500 return cdrom_release(gd.cd_info, file); 500 return cdrom_release(gd.cd_info, mode);
501} 501}
502 502
503static int gdrom_bdops_mediachanged(struct gendisk *disk) 503static int gdrom_bdops_mediachanged(struct gendisk *disk)
@@ -505,10 +505,10 @@ static int gdrom_bdops_mediachanged(struct gendisk *disk)
505 return cdrom_media_changed(gd.cd_info); 505 return cdrom_media_changed(gd.cd_info);
506} 506}
507 507
508static int gdrom_bdops_ioctl(struct inode *inode, struct file *file, 508static int gdrom_bdops_ioctl(struct block_device *bdev, fmode_t mode,
509 unsigned cmd, unsigned long arg) 509 unsigned cmd, unsigned long arg)
510{ 510{
511 return cdrom_ioctl(file, gd.cd_info, inode, cmd, arg); 511 return cdrom_ioctl(gd.cd_info, bdev, mode, cmd, arg);
512} 512}
513 513
514static struct block_device_operations gdrom_bdops = { 514static struct block_device_operations gdrom_bdops = {
@@ -516,7 +516,7 @@ static struct block_device_operations gdrom_bdops = {
516 .open = gdrom_bdops_open, 516 .open = gdrom_bdops_open,
517 .release = gdrom_bdops_release, 517 .release = gdrom_bdops_release,
518 .media_changed = gdrom_bdops_mediachanged, 518 .media_changed = gdrom_bdops_mediachanged,
519 .ioctl = gdrom_bdops_ioctl, 519 .locked_ioctl = gdrom_bdops_ioctl,
520}; 520};
521 521
522static irqreturn_t gdrom_command_interrupt(int irq, void *dev_id) 522static irqreturn_t gdrom_command_interrupt(int irq, void *dev_id)
diff --git a/drivers/cdrom/viocd.c b/drivers/cdrom/viocd.c
index 031e0e1a1a3b..13929356135c 100644
--- a/drivers/cdrom/viocd.c
+++ b/drivers/cdrom/viocd.c
@@ -151,23 +151,24 @@ static const struct file_operations proc_viocd_operations = {
151 .release = single_release, 151 .release = single_release,
152}; 152};
153 153
154static int viocd_blk_open(struct inode *inode, struct file *file) 154static int viocd_blk_open(struct block_device *bdev, fmode_t mode)
155{ 155{
156 struct disk_info *di = inode->i_bdev->bd_disk->private_data; 156 struct disk_info *di = bdev->bd_disk->private_data;
157 return cdrom_open(&di->viocd_info, inode, file); 157 return cdrom_open(&di->viocd_info, bdev, mode);
158} 158}
159 159
160static int viocd_blk_release(struct inode *inode, struct file *file) 160static int viocd_blk_release(struct gendisk *disk, fmode_t mode)
161{ 161{
162 struct disk_info *di = inode->i_bdev->bd_disk->private_data; 162 struct disk_info *di = disk->private_data;
163 return cdrom_release(&di->viocd_info, file); 163 cdrom_release(&di->viocd_info, mode);
164 return 0;
164} 165}
165 166
166static int viocd_blk_ioctl(struct inode *inode, struct file *file, 167static int viocd_blk_ioctl(struct block_device *bdev, fmode_t mode,
167 unsigned cmd, unsigned long arg) 168 unsigned cmd, unsigned long arg)
168{ 169{
169 struct disk_info *di = inode->i_bdev->bd_disk->private_data; 170 struct disk_info *di = bdev->bd_disk->private_data;
170 return cdrom_ioctl(file, &di->viocd_info, inode, cmd, arg); 171 return cdrom_ioctl(&di->viocd_info, bdev, mode, cmd, arg);
171} 172}
172 173
173static int viocd_blk_media_changed(struct gendisk *disk) 174static int viocd_blk_media_changed(struct gendisk *disk)
@@ -180,7 +181,7 @@ struct block_device_operations viocd_fops = {
180 .owner = THIS_MODULE, 181 .owner = THIS_MODULE,
181 .open = viocd_blk_open, 182 .open = viocd_blk_open,
182 .release = viocd_blk_release, 183 .release = viocd_blk_release,
183 .ioctl = viocd_blk_ioctl, 184 .locked_ioctl = viocd_blk_ioctl,
184 .media_changed = viocd_blk_media_changed, 185 .media_changed = viocd_blk_media_changed,
185}; 186};
186 187