aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ide/ide-tape.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/ide/ide-tape.c')
-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 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
2273static 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)