Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 117531
b: refs/heads/master
c: 488ca60
h: refs/heads/master
i:
  117529: b7e3c89
  117527: e5d094c
v: v3
  • Loading branch information
Al Viro committed Oct 21, 2008
1 parent 19050e8 commit 8644619
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 16 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: 4e379ae6a6b6c7b0c4274476af807ffffe42534f
refs/heads/master: 488ca606f1277ae183c9c6a328adaecae54e1930
25 changes: 10 additions & 15 deletions trunk/drivers/ide/ide-cd.c
Original file line number Diff line number Diff line change
Expand Up @@ -2089,30 +2089,27 @@ static ide_driver_t ide_cdrom_driver = {
#endif
};

static int idecd_open(struct inode *inode, struct file *file)
static int idecd_open(struct block_device *bdev, fmode_t mode)
{
struct gendisk *disk = inode->i_bdev->bd_disk;
struct cdrom_info *info;
struct cdrom_info *info = ide_cd_get(bdev->bd_disk);
int rc = -ENOMEM;

info = ide_cd_get(disk);
if (!info)
return -ENXIO;

rc = cdrom_open(&info->devinfo, inode->i_bdev, file->f_mode);
rc = cdrom_open(&info->devinfo, bdev, mode);

if (rc < 0)
ide_cd_put(info);

return rc;
}

static int idecd_release(struct inode *inode, struct file *file)
static int idecd_release(struct gendisk *disk, fmode_t mode)
{
struct gendisk *disk = inode->i_bdev->bd_disk;
struct cdrom_info *info = ide_drv_g(disk, cdrom_info);

cdrom_release(&info->devinfo, file ? file->f_mode : 0);
cdrom_release(&info->devinfo, mode);

ide_cd_put(info);

Expand Down Expand Up @@ -2158,10 +2155,9 @@ static int idecd_get_spindown(struct cdrom_device_info *cdi, unsigned long arg)
return 0;
}

static int idecd_ioctl(struct inode *inode, struct file *file,
static int idecd_ioctl(struct block_device *bdev, fmode_t mode,
unsigned int cmd, unsigned long arg)
{
struct block_device *bdev = inode->i_bdev;
struct cdrom_info *info = ide_drv_g(bdev->bd_disk, cdrom_info);
int err;

Expand All @@ -2176,8 +2172,7 @@ static int idecd_ioctl(struct inode *inode, struct file *file,

err = generic_ide_ioctl(info->drive, bdev, cmd, arg);
if (err == -EINVAL)
err = cdrom_ioctl(&info->devinfo, bdev,
file ? file->f_mode : 0, cmd, arg);
err = cdrom_ioctl(&info->devinfo, bdev, mode, cmd, arg);

return err;
}
Expand All @@ -2200,9 +2195,9 @@ static int idecd_revalidate_disk(struct gendisk *disk)

static struct block_device_operations idecd_ops = {
.owner = THIS_MODULE,
.__open = idecd_open,
.__release = idecd_release,
.__ioctl = idecd_ioctl,
.open = idecd_open,
.release = idecd_release,
.locked_ioctl = idecd_ioctl,
.media_changed = idecd_media_changed,
.revalidate_disk = idecd_revalidate_disk
};
Expand Down

0 comments on commit 8644619

Please sign in to comment.