aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ide/ide-io.c
diff options
context:
space:
mode:
authorFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>2008-07-15 15:21:51 -0400
committerBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2008-07-15 15:21:51 -0400
commit63f5abb0959337db0d5bece9cefba03cdcadec51 (patch)
tree908862cbb739d6571fab4b24f264d4d3671e6400 /drivers/ide/ide-io.c
parent7e12ca11d65f4cb29ed58ea3948f8c5d4f57b35e (diff)
ide: remove action argument in ide_do_drive_cmd
ide_do_drive_cmd is called only with ide_preempt action argument. So we can remove the action argument in ide_do_drive_cmd and ide_action_t typedef. This patch also includes two minor cleanups: 1) ide_do_drive_cmd always succeeds so we don't need the return value; 2) the callers use blk_rq_init before ide_do_drive_cmd so there is no need to initialize rq->errors. Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> Cc: Borislav Petkov <petkovbb@gmail.com> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Diffstat (limited to 'drivers/ide/ide-io.c')
-rw-r--r--drivers/ide/ide-io.c40
1 files changed, 9 insertions, 31 deletions
diff --git a/drivers/ide/ide-io.c b/drivers/ide/ide-io.c
index c28fcdf0ee9e..28057747c1f8 100644
--- a/drivers/ide/ide-io.c
+++ b/drivers/ide/ide-io.c
@@ -1520,49 +1520,27 @@ irqreturn_t ide_intr (int irq, void *dev_id)
1520 * ide_do_drive_cmd - issue IDE special command 1520 * ide_do_drive_cmd - issue IDE special command
1521 * @drive: device to issue command 1521 * @drive: device to issue command
1522 * @rq: request to issue 1522 * @rq: request to issue
1523 * @action: action for processing
1524 * 1523 *
1525 * This function issues a special IDE device request 1524 * This function issues a special IDE device request
1526 * onto the request queue. 1525 * onto the request queue.
1527 * 1526 *
1528 * If action is ide_wait, then the rq is queued at the end of the 1527 * the rq is queued at the head of the request queue, displacing
1529 * request queue, and the function sleeps until it has been processed. 1528 * the currently-being-processed request and this function
1530 * This is for use when invoked from an ioctl handler. 1529 * returns immediately without waiting for the new rq to be
1531 * 1530 * completed. This is VERY DANGEROUS, and is intended for
1532 * If action is ide_preempt, then the rq is queued at the head of 1531 * careful use by the ATAPI tape/cdrom driver code.
1533 * the request queue, displacing the currently-being-processed
1534 * request and this function returns immediately without waiting
1535 * for the new rq to be completed. This is VERY DANGEROUS, and is
1536 * intended for careful use by the ATAPI tape/cdrom driver code.
1537 *
1538 * If action is ide_end, then the rq is queued at the end of the
1539 * request queue, and the function returns immediately without waiting
1540 * for the new rq to be completed. This is again intended for careful
1541 * use by the ATAPI tape/cdrom driver code.
1542 */ 1532 */
1543 1533
1544int ide_do_drive_cmd (ide_drive_t *drive, struct request *rq, ide_action_t action) 1534void ide_do_drive_cmd(ide_drive_t *drive, struct request *rq)
1545{ 1535{
1546 unsigned long flags; 1536 unsigned long flags;
1547 ide_hwgroup_t *hwgroup = HWGROUP(drive); 1537 ide_hwgroup_t *hwgroup = HWGROUP(drive);
1548 int where = ELEVATOR_INSERT_BACK;
1549
1550 rq->errors = 0;
1551
1552 if (action == ide_preempt)
1553 where = ELEVATOR_INSERT_FRONT;
1554 1538
1555 spin_lock_irqsave(&ide_lock, flags); 1539 spin_lock_irqsave(&ide_lock, flags);
1556 if (action == ide_preempt) 1540 hwgroup->rq = NULL;
1557 hwgroup->rq = NULL; 1541 __elv_add_request(drive->queue, rq, ELEVATOR_INSERT_FRONT, 1);
1558 __elv_add_request(drive->queue, rq, where, 1);
1559 __generic_unplug_device(drive->queue); 1542 __generic_unplug_device(drive->queue);
1560 /* the queue is stopped so it won't be plugged+unplugged */
1561 if (blk_pm_resume_request(rq))
1562 do_ide_request(drive->queue);
1563 spin_unlock_irqrestore(&ide_lock, flags); 1543 spin_unlock_irqrestore(&ide_lock, flags);
1564
1565 return 0;
1566} 1544}
1567 1545
1568EXPORT_SYMBOL(ide_do_drive_cmd); 1546EXPORT_SYMBOL(ide_do_drive_cmd);