diff options
author | Borislav Petkov <petkovbb@googlemail.com> | 2008-04-27 09:38:26 -0400 |
---|---|---|
committer | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2008-04-27 09:38:26 -0400 |
commit | b361acb1083f0b313a4b398de48450f5edb81fe1 (patch) | |
tree | 39e47689857905273c228718e00504fca7549a47 /drivers | |
parent | 7f5e72f471763fe2a6e72863a64a2ef459f37835 (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.c | 24 |
1 files changed, 2 insertions, 22 deletions
diff --git a/drivers/ide/ide-tape.c b/drivers/ide/ide-tape.c index 745e2fa549b9..25ffcbffb02a 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) | |||
2270 | } | 2270 | } |
2271 | } | 2271 | } |
2272 | 2272 | ||
2273 | static int idetape_pipeline_size(ide_drive_t *drive) | ||
2274 | { | ||
2275 | idetape_tape_t *tape = drive->driver_data; | ||
2276 | idetape_stage_t *stage; | ||
2277 | struct request *rq; | ||
2278 | int size = 0; | ||
2279 | |||
2280 | idetape_wait_for_pipeline(drive); | ||
2281 | stage = tape->first_stage; | ||
2282 | while (stage != NULL) { | ||
2283 | rq = &stage->rq; | ||
2284 | size += tape->blk_size * (rq->nr_sectors - | ||
2285 | rq->current_nr_sectors); | ||
2286 | if (rq->errors == IDETAPE_ERROR_FILEMARK) | ||
2287 | size += tape->blk_size; | ||
2288 | stage = stage->next; | ||
2289 | } | ||
2290 | size += tape->merge_stage_size; | ||
2291 | return size; | ||
2292 | } | ||
2293 | |||
2294 | /* | 2273 | /* |
2295 | * Rewinds the tape to the Beginning Of the current Partition (BOP). We | 2274 | * Rewinds the tape to the Beginning Of the current Partition (BOP). We |
2296 | * currently support only one partition. | 2275 | * currently support only one partition. |
@@ -2737,7 +2716,8 @@ static int idetape_chrdev_ioctl(struct inode *inode, struct file *file, | |||
2737 | idetape_flush_tape_buffers(drive); | 2716 | idetape_flush_tape_buffers(drive); |
2738 | } | 2717 | } |
2739 | if (cmd == MTIOCGET || cmd == MTIOCPOS) { | 2718 | if (cmd == MTIOCGET || cmd == MTIOCPOS) { |
2740 | block_offset = idetape_pipeline_size(drive) / | 2719 | idetape_wait_for_pipeline(drive); |
2720 | block_offset = tape->merge_stage_size / | ||
2741 | (tape->blk_size * tape->user_bs_factor); | 2721 | (tape->blk_size * tape->user_bs_factor); |
2742 | position = idetape_read_position(drive); | 2722 | position = idetape_read_position(drive); |
2743 | if (position < 0) | 2723 | if (position < 0) |