Commit f252fa33 authored by Christoph Hellwig's avatar Christoph Hellwig Committed by Jens Axboe

hfsplus: stop using ioctl_by_bdev

Instead just call the CDROM layer functionality directly.
Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
Reviewed-by: default avatarDamien Le Moal <damien.lemoal@wdc.com>
Reviewed-by: default avatarHannes Reinecke <hare@suse.de>
Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
parent eaf8e3e4
...@@ -127,31 +127,34 @@ static int hfsplus_read_mdb(void *bufptr, struct hfsplus_wd *wd) ...@@ -127,31 +127,34 @@ static int hfsplus_read_mdb(void *bufptr, struct hfsplus_wd *wd)
static int hfsplus_get_last_session(struct super_block *sb, static int hfsplus_get_last_session(struct super_block *sb,
sector_t *start, sector_t *size) sector_t *start, sector_t *size)
{ {
struct cdrom_multisession ms_info; struct cdrom_device_info *cdi = disk_to_cdi(sb->s_bdev->bd_disk);
struct cdrom_tocentry te;
int res;
/* default values */ /* default values */
*start = 0; *start = 0;
*size = i_size_read(sb->s_bdev->bd_inode) >> 9; *size = i_size_read(sb->s_bdev->bd_inode) >> 9;
if (HFSPLUS_SB(sb)->session >= 0) { if (HFSPLUS_SB(sb)->session >= 0) {
struct cdrom_tocentry te;
if (!cdi)
return -EINVAL;
te.cdte_track = HFSPLUS_SB(sb)->session; te.cdte_track = HFSPLUS_SB(sb)->session;
te.cdte_format = CDROM_LBA; te.cdte_format = CDROM_LBA;
res = ioctl_by_bdev(sb->s_bdev, if (cdrom_read_tocentry(cdi, &te) ||
CDROMREADTOCENTRY, (unsigned long)&te); (te.cdte_ctrl & CDROM_DATA_TRACK) != 4) {
if (!res && (te.cdte_ctrl & CDROM_DATA_TRACK) == 4) {
*start = (sector_t)te.cdte_addr.lba << 2;
return 0;
}
pr_err("invalid session number or type of track\n"); pr_err("invalid session number or type of track\n");
return -EINVAL; return -EINVAL;
} }
*start = (sector_t)te.cdte_addr.lba << 2;
} else if (cdi) {
struct cdrom_multisession ms_info;
ms_info.addr_format = CDROM_LBA; ms_info.addr_format = CDROM_LBA;
res = ioctl_by_bdev(sb->s_bdev, CDROMMULTISESSION, if (cdrom_multisession(cdi, &ms_info) == 0 && ms_info.xa_flag)
(unsigned long)&ms_info);
if (!res && ms_info.xa_flag)
*start = (sector_t)ms_info.addr.lba << 2; *start = (sector_t)ms_info.addr.lba << 2;
}
return 0; return 0;
} }
......
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