Commit fb1ba406 authored by Christoph Hellwig's avatar Christoph Hellwig Committed by Martin K. Petersen

scsi: scsi_ioctl: Remove scsi_cmd_blk_ioctl()

Open code scsi_cmd_blk_ioctl() in its two callers.

Link: https://lore.kernel.org/r/20210724072033.1284840-10-hch@lst.deSigned-off-by: default avatarChristoph Hellwig <hch@lst.de>
Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
parent e9ee7fea
...@@ -854,19 +854,6 @@ int scsi_verify_blk_ioctl(struct block_device *bd, unsigned int cmd) ...@@ -854,19 +854,6 @@ int scsi_verify_blk_ioctl(struct block_device *bd, unsigned int cmd)
} }
EXPORT_SYMBOL(scsi_verify_blk_ioctl); EXPORT_SYMBOL(scsi_verify_blk_ioctl);
int scsi_cmd_blk_ioctl(struct block_device *bd, fmode_t mode,
unsigned int cmd, void __user *arg)
{
int ret;
ret = scsi_verify_blk_ioctl(bd, cmd);
if (ret < 0)
return ret;
return scsi_cmd_ioctl(bd->bd_disk->queue, bd->bd_disk, mode, cmd, arg);
}
EXPORT_SYMBOL(scsi_cmd_blk_ioctl);
/** /**
* scsi_req_init - initialize certain fields of a scsi_request structure * scsi_req_init - initialize certain fields of a scsi_request structure
* @req: Pointer to a scsi_request structure. * @req: Pointer to a scsi_request structure.
......
...@@ -1583,7 +1583,10 @@ static int sd_ioctl(struct block_device *bdev, fmode_t mode, ...@@ -1583,7 +1583,10 @@ static int sd_ioctl(struct block_device *bdev, fmode_t mode,
case SCSI_IOCTL_GET_BUS_NUMBER: case SCSI_IOCTL_GET_BUS_NUMBER:
break; break;
default: default:
error = scsi_cmd_blk_ioctl(bdev, mode, cmd, p); error = scsi_verify_blk_ioctl(bdev, cmd);
if (error < 0)
return error;
error = scsi_cmd_ioctl(disk->queue, disk, mode, cmd, p);
if (error != -ENOTTY) if (error != -ENOTTY)
return error; return error;
} }
......
...@@ -556,7 +556,8 @@ static void sr_block_release(struct gendisk *disk, fmode_t mode) ...@@ -556,7 +556,8 @@ static void sr_block_release(struct gendisk *disk, fmode_t mode)
static int sr_block_ioctl(struct block_device *bdev, fmode_t mode, unsigned cmd, static int sr_block_ioctl(struct block_device *bdev, fmode_t mode, unsigned cmd,
unsigned long arg) unsigned long arg)
{ {
struct scsi_cd *cd = scsi_cd(bdev->bd_disk); struct gendisk *disk = bdev->bd_disk;
struct scsi_cd *cd = scsi_cd(disk);
struct scsi_device *sdev = cd->device; struct scsi_device *sdev = cd->device;
void __user *argp = (void __user *)arg; void __user *argp = (void __user *)arg;
int ret; int ret;
...@@ -579,7 +580,10 @@ static int sr_block_ioctl(struct block_device *bdev, fmode_t mode, unsigned cmd, ...@@ -579,7 +580,10 @@ static int sr_block_ioctl(struct block_device *bdev, fmode_t mode, unsigned cmd,
case SCSI_IOCTL_GET_BUS_NUMBER: case SCSI_IOCTL_GET_BUS_NUMBER:
break; break;
default: default:
ret = scsi_cmd_blk_ioctl(bdev, mode, cmd, argp); ret = scsi_verify_blk_ioctl(bdev, cmd);
if (ret < 0)
goto put;
ret = scsi_cmd_ioctl(disk->queue, disk, mode, cmd, argp);
if (ret != -ENOTTY) if (ret != -ENOTTY)
goto put; goto put;
ret = cdrom_ioctl(&cd->cdi, bdev, mode, cmd, arg); ret = cdrom_ioctl(&cd->cdi, bdev, mode, cmd, arg);
......
...@@ -889,8 +889,6 @@ extern blk_status_t blk_insert_cloned_request(struct request_queue *q, ...@@ -889,8 +889,6 @@ extern blk_status_t blk_insert_cloned_request(struct request_queue *q,
int blk_rq_append_bio(struct request *rq, struct bio *bio); int blk_rq_append_bio(struct request *rq, struct bio *bio);
extern void blk_queue_split(struct bio **); extern void blk_queue_split(struct bio **);
extern int scsi_verify_blk_ioctl(struct block_device *, unsigned int); extern int scsi_verify_blk_ioctl(struct block_device *, unsigned int);
extern int scsi_cmd_blk_ioctl(struct block_device *, fmode_t,
unsigned int, void __user *);
extern int scsi_cmd_ioctl(struct request_queue *, struct gendisk *, fmode_t, extern int scsi_cmd_ioctl(struct request_queue *, struct gendisk *, fmode_t,
unsigned int, void __user *); unsigned int, void __user *);
extern int sg_scsi_ioctl(struct request_queue *, struct gendisk *, fmode_t, extern int sg_scsi_ioctl(struct request_queue *, struct gendisk *, fmode_t,
......
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