last missing patch in the cdrom ioctl_by_bdev removal series
Subsystems (3)
PATCH RESEND 1/1 last missing patch in the cdrom ioctl_by_bdev removal series
Hi Jens,
can you pick up this patch, which is the last missing one in converting file systems away from using ioctl_by_bdev for CDROM information access?
PATCH 1/1 hfs: stop using ioctl_by_bdev
Instead just call the CDROM layer functionality directly.
Signed-off-by Christoph Hellwig <[email protected]>
--- fs/hfs/mdb.c | 32 +++++++++++++++++++------------- 1 file changed, 19 insertions(+), 13 deletions(-)
fs/hfs/mdb.c +19 -13
@@ -32,29 +32,35 @@static int hfs_get_last_session (struct super_block *sb,sector_t *start,sector_t *size) { -struct cdrom_multisession ms_info; -struct cdrom_tocentry te; -int res; +struct cdrom_device_info *cdi =disk_to_cdi (sb->s_bdev->bd_disk);/* default values */ *start =0 ; *size =i_size_read (sb->s_bdev->bd_inode) >>9 ;if (HFS_SB (sb)->session >=0 ) { +struct cdrom_tocentry te; + +if (!cdi) +return -EINVAL ; + te.cdte_track =HFS_SB (sb)->session; te.cdte_format =CDROM_LBA ; - res =ioctl_by_bdev (sb->s_bdev,CDROMREADTOCENTRY , (unsigned long )&te); -if (!res && (te.cdte_ctrl &CDROM_DATA_TRACK ) ==4 ) { - *start = (sector_t )te.cdte_addr.lba <<2 ; -return 0 ; +if (cdrom_read_tocentry (cdi, &te) || + (te.cdte_ctrl &CDROM_DATA_TRACK ) !=4 ) { +pr_err ("invalid session number or type of track\n" ); +return -EINVAL ; } -pr_err ("invalid session number or type of track\n" ); -return -EINVAL ; + + *start = (sector_t )te.cdte_addr.lba <<2 ; + }else if (cdi) { +struct cdrom_multisession ms_info; + + ms_info.addr_format =CDROM_LBA ; +if (cdrom_multisession (cdi, &ms_info) ==0 && ms_info.xa_flag) + *start = (sector_t )ms_info.addr.lba <<2 ; } - ms_info.addr_format =CDROM_LBA ; - res =ioctl_by_bdev (sb->s_bdev,CDROMMULTISESSION , (unsigned long )&ms_info); -if (!res && ms_info.xa_flag) - *start = (sector_t )ms_info.addr.lba <<2 ; +return 0 ; }
Signature · 1 line
2.26.2
Re: [PATCH] hfs: stop using ioctl_by_bdev
Quoted 1 line · Christoph Hellwig
Instead just call the CDROM layer functionality directly.
Applied, thanks.
Signature · 1 line
Jens Axboe