aboutsummaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorBorislav Petkov <petkovbb@googlemail.com>2008-04-27 15:38:26 +0200
committerBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2008-04-27 15:38:26 +0200
commitb361acb1083f0b313a4b398de48450f5edb81fe1 (patch)
tree39e47689857905273c228718e00504fca7549a47 /drivers
parent7f5e72f471763fe2a6e72863a64a2ef459f37835 (diff)
ide-tape: remove idetape_pipeline_size()
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. [bart: resurrect deleted idetape_wait_for_pipeline() call] Signed-off-by: Borislav Petkov <petkovbb@gmail.com> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/ide/ide-tape.c24
1 files changed, 2 insertions, 22 deletions
diff --git a/drivers/ide/ide-tape.c b/drivers/ide/ide-tape.c
index 745e2fa549b..25ffcbffb02 100644
--- a/drivers/ide/ide-tape.c
+++ b/drivers/ide/ide-tape.c
@@ -2270,27 +2270,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.
@@ -2737,7 +2716,8 @@ 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) /
+ idetape_wait_for_pipeline(drive);
+ block_offset = tape->merge_stage_size /
(tape->blk_size * tape->user_bs_factor);
position = idetape_read_position(drive);
if (position < 0)