[PATCH 10/18] ide-cd: move request prep from cdrom_start_seek_continuation to rq issue path

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: <bzolnier@...>
Cc: <linux-kernel@...>, <linux-ide@...>, Borislav Petkov <petkovbb@...>
Date: Thursday, June 12, 2008 - 2:41 am

... by factoring out the rq preparation code into a separate
function called in the request routine. Bart: As a nice
side effect, this minimizes the IRQ handler execution time.

There should be no functionality change resulting from this patch.

Signed-off-by: Borislav Petkov <petkovbb@gmail.com>
---
 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 b8c98e1..da0f28c 100644
--- a/drivers/ide/ide-cd.c
+++ b/drivers/ide/ide-cd.c
@@ -763,9 +763,8 @@ static ide_startstop_t cdrom_seek_intr(ide_drive_t *drive)
 	return ide_stopped;
 }
 
-static ide_startstop_t cdrom_start_seek_continuation(ide_drive_t *drive)
+static void ide_cd_prepare_seek_request(ide_drive_t *drive, struct request *rq)
 {
-	struct request *rq = HWGROUP(drive)->rq;
 	sector_t frame = rq->sector;
 
 	sector_div(frame, queue_hardsect_size(drive->queue) >> SECTOR_BITS);
@@ -775,6 +774,11 @@ static ide_startstop_t cdrom_start_seek_continuation(ide_drive_t *drive)
 	put_unaligned(cpu_to_be32(frame), (unsigned int *) &rq->cmd[2]);
 
 	rq->timeout = ATAPI_WAIT_PC;
+}
+
+static ide_startstop_t cdrom_start_seek_continuation(ide_drive_t *drive)
+{
+	struct request *rq = HWGROUP(drive)->rq;
 	return cdrom_transfer_packet_command(drive, rq, &cdrom_seek_intr);
 }
 
@@ -1223,10 +1227,14 @@ static ide_startstop_t ide_cd_do_request(ide_drive_t *drive, struct request *rq,
 		    IDE_LARGE_SEEK(info->last_block, block,
 			    IDECD_SEEK_THRESHOLD) &&
 		    drive->dsc_overlap) {
+
 			xferlen = 0;
 			fn = cdrom_start_seek_continuation;
 			info->dma = 0;
 			info->start_seek = jiffies;
+
+			ide_cd_prepare_seek_request(drive, rq);
+
 		} else {
 			xferlen = 32768;
 			fn = cdrom_start_rw_cont;
-- 
1.5.5.1

--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH 00/18] misc generic ide stuff, Borislav Petkov, (Thu Jun 12, 2:40 am)
Re: [PATCH 00/18] misc generic ide stuff, Bartlomiej Zolnierkiewicz..., (Sat Jun 14, 1:29 pm)
Re: [PATCH 00/18] misc generic ide stuff, Borislav Petkov, (Sun Jun 15, 6:27 am)
[PATCH 13/18] ide-floppy: replace pc-&gt;c with rq-&gt;cmd, Borislav Petkov, (Thu Jun 12, 2:41 am)
Re: [PATCH 13/18] ide-floppy: replace pc-&gt;c with rq-&gt;cmd, Bartlomiej Zolnierkiewicz..., (Sat Jun 14, 1:40 pm)
Re: [PATCH 13/18] ide-floppy: replace pc-&gt;c with rq-&gt;cmd, Bartlomiej Zolnierkiewicz..., (Sun Jun 15, 10:57 am)
Re: [PATCH 02/18] ide-cd: remove ide_cd_drain_data and ide_c..., Bartlomiej Zolnierkiewicz..., (Sat Jun 14, 1:29 pm)
[PATCH 08/18] ide-cd: simplify request issuing path, Borislav Petkov, (Thu Jun 12, 2:41 am)
[PATCH 10/18] ide-cd: move request prep from cdrom_start_see..., Borislav Petkov, (Thu Jun 12, 2:41 am)
[PATCH 17/18] ide-floppy: cleanup idefloppy_create_rw_cmd, Borislav Petkov, (Thu Jun 12, 2:41 am)
[PATCH 18/18] ide: use flags in IRQ handler, Borislav Petkov, (Thu Jun 12, 2:41 am)
Re: [PATCH 18/18] ide: use flags in IRQ handler, Bartlomiej Zolnierkiewicz..., (Sat Jun 14, 1:47 pm)
[PATCH 07/18] ide-cd: mv ide_do_rw_cdrom ide_cd_do_request, Borislav Petkov, (Thu Jun 12, 2:40 am)
Re: [PATCH 03/18] ide-cd: cdrom_decode_status: factor out bl..., Bartlomiej Zolnierkiewicz..., (Sat Jun 14, 1:29 pm)