[PATCH 06/17] ide-tape: remove idetape_pipeline_size()

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Borislav Petkov
Date: Sunday, March 16, 2008 - 11:41 pm

The computation of the block offset of the the tape position (MTIOCPOS,
MTIOCGET) is not influenced by the stages queued in the pipeline anymore but by
the size of the current buffer which is going to be sent to the drive.

Signed-off-by: Borislav Petkov <petkovbb@gmail.com>
---
 drivers/ide/ide-tape.c |   23 +----------------------
 1 files changed, 1 insertions(+), 22 deletions(-)

diff --git a/drivers/ide/ide-tape.c b/drivers/ide/ide-tape.c
index 3b324bb..5a6b657 100644
--- a/drivers/ide/ide-tape.c
+++ b/drivers/ide/ide-tape.c
@@ -2128,27 +2128,6 @@ static void idetape_pad_zeros(ide_drive_t *drive, int bcount)
 	}
 }
 
-static int idetape_pipeline_size(ide_drive_t *drive)
-{
-	idetape_tape_t *tape = drive->driver_data;
-	idetape_stage_t *stage;
-	struct request *rq;
-	int size = 0;
-
-	idetape_wait_for_pipeline(drive);
-	stage = tape->first_stage;
-	while (stage != NULL) {
-		rq = &stage->rq;
-		size += tape->blk_size * (rq->nr_sectors -
-				rq->current_nr_sectors);
-		if (rq->errors == IDETAPE_ERROR_FILEMARK)
-			size += tape->blk_size;
-		stage = stage->next;
-	}
-	size += tape->merge_stage_size;
-	return size;
-}
-
 /*
  * Rewinds the tape to the Beginning Of the current Partition (BOP). We
  * currently support only one partition.
@@ -2580,7 +2559,7 @@ static int idetape_chrdev_ioctl(struct inode *inode, struct file *file,
 		idetape_flush_tape_buffers(drive);
 	}
 	if (cmd == MTIOCGET || cmd == MTIOCPOS) {
-		block_offset = idetape_pipeline_size(drive) /
+		block_offset = tape->merge_stage_size /
 			(tape->blk_size * tape->user_bs_factor);
 		position = idetape_read_position(drive);
 		if (position < 0)
-- 
1.5.4.1

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

Messages in current thread:
[PATCH 0/17] ide-tape: remove pipeline functionality-v3, Borislav Petkov, (Sun Mar 16, 11:41 pm)
[PATCH 04/17] ide-tape: remove idetape_empty_write_pipeline(), Borislav Petkov, (Sun Mar 16, 11:41 pm)
[PATCH 06/17] ide-tape: remove idetape_pipeline_size(), Borislav Petkov, (Sun Mar 16, 11:41 pm)
[PATCH 07/17] ide-tape: remove idetape_remove_stage_head(), Borislav Petkov, (Sun Mar 16, 11:41 pm)
[PATCH 09/17] ide-tape: unwrap idetape_queue_pc_tail(), Borislav Petkov, (Sun Mar 16, 11:41 pm)
[PATCH 12/17] ide-tape: remove pipelined mode parameters, Borislav Petkov, (Sun Mar 16, 11:41 pm)
[PATCH 16/17] ide-tape: remove pipelined mode description ..., Borislav Petkov, (Sun Mar 16, 11:41 pm)
Re: [PATCH 01/17] ide-tape: remove unused parameter from i ..., Bartlomiej Zolnierki ..., (Thu Mar 20, 2:42 pm)
Re: [PATCH 02/17] ide-tape: remove unused parameter from i ..., Bartlomiej Zolnierki ..., (Thu Mar 20, 2:42 pm)
Re: [PATCH 0/17] ide-tape: remove pipeline functionality-v3, Bartlomiej Zolnierki ..., (Thu Mar 20, 5:04 pm)
Re: [PATCH 03/17] ide-tape: remove idetape_discard_read_pi ..., Bartlomiej Zolnierki ..., (Thu Mar 20, 5:09 pm)
Re: [PATCH 04/17] ide-tape: remove idetape_empty_write_pip ..., Bartlomiej Zolnierki ..., (Thu Mar 20, 5:09 pm)
Re: [PATCH 05/17] ide-tape: remove pipeline-specific code ..., Bartlomiej Zolnierki ..., (Thu Mar 20, 5:09 pm)
Re: [PATCH 06/17] ide-tape: remove idetape_pipeline_size(), Bartlomiej Zolnierki ..., (Thu Mar 20, 5:09 pm)
Re: [PATCH 07/17] ide-tape: remove idetape_remove_stage_head(), Bartlomiej Zolnierki ..., (Thu Mar 20, 5:09 pm)
Re: [PATCH 08/17] ide-tape: remove pipeline-specific code ..., Bartlomiej Zolnierki ..., (Thu Mar 20, 5:09 pm)
Re: [PATCH 09/17] ide-tape: unwrap idetape_queue_pc_tail(), Bartlomiej Zolnierki ..., (Thu Mar 20, 5:09 pm)
Re: [PATCH 10/17] ide-tape: remove remaining pipeline func ..., Bartlomiej Zolnierki ..., (Thu Mar 20, 5:09 pm)
Re: [PATCH 11/17] ide-tape: remove pipeline-specific code ..., Bartlomiej Zolnierki ..., (Thu Mar 20, 5:09 pm)
Re: [PATCH 13/17] ide-tape: remove pipelined mode tape con ..., Bartlomiej Zolnierki ..., (Thu Mar 20, 5:09 pm)
Re: [PATCH 14/17] ide-tape: remove pipeline-specific membe ..., Bartlomiej Zolnierki ..., (Thu Mar 20, 5:09 pm)
Re: [PATCH 12/17] ide-tape: remove pipelined mode parameters, Bartlomiej Zolnierki ..., (Thu Mar 20, 5:09 pm)
Re: [PATCH 15/17] ide-tape: remove misc references to pipe ..., Bartlomiej Zolnierki ..., (Thu Mar 20, 5:09 pm)
Re: [PATCH 16/17] ide-tape: remove pipelined mode descript ..., Bartlomiej Zolnierki ..., (Thu Mar 20, 5:09 pm)
Re: [PATCH 17/17] ide-tape: remove comments markup from Do ..., Bartlomiej Zolnierki ..., (Thu Mar 20, 5:09 pm)