diff options
author | Borislav Petkov <petkovbb@googlemail.com> | 2008-07-16 14:33:46 -0400 |
---|---|---|
committer | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2008-07-16 14:33:46 -0400 |
commit | e529c6087a845e64a6a36a2d17b8754b20bc7c0d (patch) | |
tree | 2ded1375fdda50c1fa95cc04ed20c9ed93fcbf59 | |
parent | 4b01fcbbe69bba34a8494fca6376ac0804f0f51d (diff) |
ide-cd: move request prep from cdrom_start_seek_continuation to rq issue path
... by factoring out the rq preparation code into a separate
function called in the request routine. As a nice side effect,
this minimizes the IRQ handler execution time.
There should be no functionality change resulting from this patch.
[bart: s/HWGROUP()/drive->hwif->hwgroup/ and remove extra newlines]
Signed-off-by: Borislav Petkov <petkovbb@gmail.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
-rw-r--r-- | drivers/ide/ide-cd.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/drivers/ide/ide-cd.c b/drivers/ide/ide-cd.c index 66d82c1b16eb..275d5ba12027 100644 --- a/drivers/ide/ide-cd.c +++ b/drivers/ide/ide-cd.c | |||
@@ -738,9 +738,8 @@ static ide_startstop_t cdrom_seek_intr(ide_drive_t *drive) | |||
738 | return ide_stopped; | 738 | return ide_stopped; |
739 | } | 739 | } |
740 | 740 | ||
741 | static ide_startstop_t cdrom_start_seek_continuation(ide_drive_t *drive) | 741 | static void ide_cd_prepare_seek_request(ide_drive_t *drive, struct request *rq) |
742 | { | 742 | { |
743 | struct request *rq = HWGROUP(drive)->rq; | ||
744 | sector_t frame = rq->sector; | 743 | sector_t frame = rq->sector; |
745 | 744 | ||
746 | sector_div(frame, queue_hardsect_size(drive->queue) >> SECTOR_BITS); | 745 | sector_div(frame, queue_hardsect_size(drive->queue) >> SECTOR_BITS); |
@@ -750,6 +749,12 @@ static ide_startstop_t cdrom_start_seek_continuation(ide_drive_t *drive) | |||
750 | put_unaligned(cpu_to_be32(frame), (unsigned int *) &rq->cmd[2]); | 749 | put_unaligned(cpu_to_be32(frame), (unsigned int *) &rq->cmd[2]); |
751 | 750 | ||
752 | rq->timeout = ATAPI_WAIT_PC; | 751 | rq->timeout = ATAPI_WAIT_PC; |
752 | } | ||
753 | |||
754 | static ide_startstop_t cdrom_start_seek_continuation(ide_drive_t *drive) | ||
755 | { | ||
756 | struct request *rq = drive->hwif->hwgroup->rq; | ||
757 | |||
753 | return cdrom_transfer_packet_command(drive, rq, &cdrom_seek_intr); | 758 | return cdrom_transfer_packet_command(drive, rq, &cdrom_seek_intr); |
754 | } | 759 | } |
755 | 760 | ||
@@ -1211,8 +1216,11 @@ static ide_startstop_t ide_cd_do_request(ide_drive_t *drive, struct request *rq, | |||
1211 | drive->dsc_overlap) { | 1216 | drive->dsc_overlap) { |
1212 | xferlen = 0; | 1217 | xferlen = 0; |
1213 | fn = cdrom_start_seek_continuation; | 1218 | fn = cdrom_start_seek_continuation; |
1219 | |||
1214 | info->dma = 0; | 1220 | info->dma = 0; |
1215 | info->start_seek = jiffies; | 1221 | info->start_seek = jiffies; |
1222 | |||
1223 | ide_cd_prepare_seek_request(drive, rq); | ||
1216 | } else { | 1224 | } else { |
1217 | xferlen = 32768; | 1225 | xferlen = 32768; |
1218 | fn = cdrom_start_rw_cont; | 1226 | fn = cdrom_start_rw_cont; |