aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
Diffstat (limited to 'drivers')
-rw-r--r--drivers/block/ub.c2
-rw-r--r--drivers/cdrom/cdrom.c3
-rw-r--r--drivers/ide/ide-floppy.c29
-rw-r--r--drivers/ide/ide.c10
-rw-r--r--drivers/scsi/sd.c2
-rw-r--r--drivers/scsi/st.c3
6 files changed, 27 insertions, 22 deletions
diff --git a/drivers/block/ub.c b/drivers/block/ub.c
index 18c8b6c0db20..8b13d7d2cb63 100644
--- a/drivers/block/ub.c
+++ b/drivers/block/ub.c
@@ -1709,7 +1709,7 @@ static int ub_bd_ioctl(struct inode *inode, struct file *filp,
1709 struct gendisk *disk = inode->i_bdev->bd_disk; 1709 struct gendisk *disk = inode->i_bdev->bd_disk;
1710 void __user *usermem = (void __user *) arg; 1710 void __user *usermem = (void __user *) arg;
1711 1711
1712 return scsi_cmd_ioctl(filp, disk, cmd, usermem); 1712 return scsi_cmd_ioctl(filp, disk->queue, disk, cmd, usermem);
1713} 1713}
1714 1714
1715/* 1715/*
diff --git a/drivers/cdrom/cdrom.c b/drivers/cdrom/cdrom.c
index aa5468f487ba..499019bf8f40 100644
--- a/drivers/cdrom/cdrom.c
+++ b/drivers/cdrom/cdrom.c
@@ -2695,11 +2695,12 @@ int cdrom_ioctl(struct file * file, struct cdrom_device_info *cdi,
2695{ 2695{
2696 void __user *argp = (void __user *)arg; 2696 void __user *argp = (void __user *)arg;
2697 int ret; 2697 int ret;
2698 struct gendisk *disk = ip->i_bdev->bd_disk;
2698 2699
2699 /* 2700 /*
2700 * Try the generic SCSI command ioctl's first. 2701 * Try the generic SCSI command ioctl's first.
2701 */ 2702 */
2702 ret = scsi_cmd_ioctl(file, ip->i_bdev->bd_disk, cmd, argp); 2703 ret = scsi_cmd_ioctl(file, disk->queue, disk, cmd, argp);
2703 if (ret != -ENOTTY) 2704 if (ret != -ENOTTY)
2704 return ret; 2705 return ret;
2705 2706
diff --git a/drivers/ide/ide-floppy.c b/drivers/ide/ide-floppy.c
index f429be88c4f9..a21f585b1caa 100644
--- a/drivers/ide/ide-floppy.c
+++ b/drivers/ide/ide-floppy.c
@@ -1258,19 +1258,25 @@ static void idefloppy_create_rw_cmd (idefloppy_floppy_t *floppy, idefloppy_pc_t
1258 set_bit(PC_DMA_RECOMMENDED, &pc->flags); 1258 set_bit(PC_DMA_RECOMMENDED, &pc->flags);
1259} 1259}
1260 1260
1261static int 1261static void
1262idefloppy_blockpc_cmd(idefloppy_floppy_t *floppy, idefloppy_pc_t *pc, struct request *rq) 1262idefloppy_blockpc_cmd(idefloppy_floppy_t *floppy, idefloppy_pc_t *pc, struct request *rq)
1263{ 1263{
1264 /*
1265 * just support eject for now, it would not be hard to make the
1266 * REQ_BLOCK_PC support fully-featured
1267 */
1268 if (rq->cmd[0] != IDEFLOPPY_START_STOP_CMD)
1269 return 1;
1270
1271 idefloppy_init_pc(pc); 1264 idefloppy_init_pc(pc);
1265 pc->callback = &idefloppy_rw_callback;
1272 memcpy(pc->c, rq->cmd, sizeof(pc->c)); 1266 memcpy(pc->c, rq->cmd, sizeof(pc->c));
1273 return 0; 1267 pc->rq = rq;
1268 pc->b_count = rq->data_len;
1269 if (rq->data_len && rq_data_dir(rq) == WRITE)
1270 set_bit(PC_WRITING, &pc->flags);
1271 pc->buffer = rq->data;
1272 if (rq->bio)
1273 set_bit(PC_DMA_RECOMMENDED, &pc->flags);
1274
1275 /*
1276 * possibly problematic, doesn't look like ide-floppy correctly
1277 * handled scattered requests if dma fails...
1278 */
1279 pc->request_transfer = pc->buffer_size = rq->data_len;
1274} 1280}
1275 1281
1276/* 1282/*
@@ -1317,10 +1323,7 @@ static ide_startstop_t idefloppy_do_request (ide_drive_t *drive, struct request
1317 pc = (idefloppy_pc_t *) rq->buffer; 1323 pc = (idefloppy_pc_t *) rq->buffer;
1318 } else if (blk_pc_request(rq)) { 1324 } else if (blk_pc_request(rq)) {
1319 pc = idefloppy_next_pc_storage(drive); 1325 pc = idefloppy_next_pc_storage(drive);
1320 if (idefloppy_blockpc_cmd(floppy, pc, rq)) { 1326 idefloppy_blockpc_cmd(floppy, pc, rq);
1321 idefloppy_do_end_request(drive, 0, 0);
1322 return ide_stopped;
1323 }
1324 } else { 1327 } else {
1325 blk_dump_rq_flags(rq, 1328 blk_dump_rq_flags(rq,
1326 "ide-floppy: unsupported command in queue"); 1329 "ide-floppy: unsupported command in queue");
diff --git a/drivers/ide/ide.c b/drivers/ide/ide.c
index c948a5c17a5d..8cd7694593c9 100644
--- a/drivers/ide/ide.c
+++ b/drivers/ide/ide.c
@@ -1049,9 +1049,13 @@ int generic_ide_ioctl(ide_drive_t *drive, struct file *file, struct block_device
1049 unsigned long flags; 1049 unsigned long flags;
1050 ide_driver_t *drv; 1050 ide_driver_t *drv;
1051 void __user *p = (void __user *)arg; 1051 void __user *p = (void __user *)arg;
1052 int err = 0, (*setfunc)(ide_drive_t *, int); 1052 int err, (*setfunc)(ide_drive_t *, int);
1053 u8 *val; 1053 u8 *val;
1054 1054
1055 err = scsi_cmd_ioctl(file, bdev->bd_disk->queue, bdev->bd_disk, cmd, p);
1056 if (err != -ENOTTY)
1057 return err;
1058
1055 switch (cmd) { 1059 switch (cmd) {
1056 case HDIO_GET_32BIT: val = &drive->io_32bit; goto read_val; 1060 case HDIO_GET_32BIT: val = &drive->io_32bit; goto read_val;
1057 case HDIO_GET_KEEPSETTINGS: val = &drive->keep_settings; goto read_val; 1061 case HDIO_GET_KEEPSETTINGS: val = &drive->keep_settings; goto read_val;
@@ -1171,10 +1175,6 @@ int generic_ide_ioctl(ide_drive_t *drive, struct file *file, struct block_device
1171 return 0; 1175 return 0;
1172 } 1176 }
1173 1177
1174 case CDROMEJECT:
1175 case CDROMCLOSETRAY:
1176 return scsi_cmd_ioctl(file, bdev->bd_disk, cmd, p);
1177
1178 case HDIO_GET_BUSSTATE: 1178 case HDIO_GET_BUSSTATE:
1179 if (!capable(CAP_SYS_ADMIN)) 1179 if (!capable(CAP_SYS_ADMIN))
1180 return -EACCES; 1180 return -EACCES;
diff --git a/drivers/scsi/sd.c b/drivers/scsi/sd.c
index 448d316f12d7..424d557284a9 100644
--- a/drivers/scsi/sd.c
+++ b/drivers/scsi/sd.c
@@ -684,7 +684,7 @@ static int sd_ioctl(struct inode * inode, struct file * filp,
684 case SCSI_IOCTL_GET_BUS_NUMBER: 684 case SCSI_IOCTL_GET_BUS_NUMBER:
685 return scsi_ioctl(sdp, cmd, p); 685 return scsi_ioctl(sdp, cmd, p);
686 default: 686 default:
687 error = scsi_cmd_ioctl(filp, disk, cmd, p); 687 error = scsi_cmd_ioctl(filp, disk->queue, disk, cmd, p);
688 if (error != -ENOTTY) 688 if (error != -ENOTTY)
689 return error; 689 return error;
690 } 690 }
diff --git a/drivers/scsi/st.c b/drivers/scsi/st.c
index 55bfeccf68a2..a4f7b8465773 100644
--- a/drivers/scsi/st.c
+++ b/drivers/scsi/st.c
@@ -3549,7 +3549,8 @@ static int st_ioctl(struct inode *inode, struct file *file,
3549 !capable(CAP_SYS_RAWIO)) 3549 !capable(CAP_SYS_RAWIO))
3550 i = -EPERM; 3550 i = -EPERM;
3551 else 3551 else
3552 i = scsi_cmd_ioctl(file, STp->disk, cmd_in, p); 3552 i = scsi_cmd_ioctl(file, STp->disk->queue,
3553 STp->disk, cmd_in, p);
3553 if (i != -ENOTTY) 3554 if (i != -ENOTTY)
3554 return i; 3555 return i;
3555 break; 3556 break;