diff options
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/ide/ide-tape.c | 53 |
1 files changed, 0 insertions, 53 deletions
diff --git a/drivers/ide/ide-tape.c b/drivers/ide/ide-tape.c index de70cb7789f2..745e2fa549b9 100644 --- a/drivers/ide/ide-tape.c +++ b/drivers/ide/ide-tape.c | |||
@@ -2051,19 +2051,6 @@ static void idetape_create_space_cmd(struct ide_atapi_pc *pc, int count, u8 cmd) | |||
2051 | pc->idetape_callback = &idetape_pc_callback; | 2051 | pc->idetape_callback = &idetape_pc_callback; |
2052 | } | 2052 | } |
2053 | 2053 | ||
2054 | static void idetape_wait_first_stage(ide_drive_t *drive) | ||
2055 | { | ||
2056 | idetape_tape_t *tape = drive->driver_data; | ||
2057 | unsigned long flags; | ||
2058 | |||
2059 | if (tape->first_stage == NULL) | ||
2060 | return; | ||
2061 | spin_lock_irqsave(&tape->lock, flags); | ||
2062 | if (tape->active_stage == tape->first_stage) | ||
2063 | idetape_wait_for_request(drive, tape->active_data_rq); | ||
2064 | spin_unlock_irqrestore(&tape->lock, flags); | ||
2065 | } | ||
2066 | |||
2067 | /* Queue up a character device originated write request. */ | 2054 | /* Queue up a character device originated write request. */ |
2068 | static int idetape_add_chrdev_write_request(ide_drive_t *drive, int blocks) | 2055 | static int idetape_add_chrdev_write_request(ide_drive_t *drive, int blocks) |
2069 | { | 2056 | { |
@@ -2363,19 +2350,11 @@ static int idetape_blkdev_ioctl(ide_drive_t *drive, unsigned int cmd, | |||
2363 | return 0; | 2350 | return 0; |
2364 | } | 2351 | } |
2365 | 2352 | ||
2366 | /* | ||
2367 | * The function below is now a bit more complicated than just passing the | ||
2368 | * command to the tape since we may have crossed some filemarks during our | ||
2369 | * pipelined read-ahead mode. As a minor side effect, the pipeline enables us to | ||
2370 | * support MTFSFM when the filemark is in our internal pipeline even if the tape | ||
2371 | * doesn't support spacing over filemarks in the reverse direction. | ||
2372 | */ | ||
2373 | static int idetape_space_over_filemarks(ide_drive_t *drive, short mt_op, | 2353 | static int idetape_space_over_filemarks(ide_drive_t *drive, short mt_op, |
2374 | int mt_count) | 2354 | int mt_count) |
2375 | { | 2355 | { |
2376 | idetape_tape_t *tape = drive->driver_data; | 2356 | idetape_tape_t *tape = drive->driver_data; |
2377 | struct ide_atapi_pc pc; | 2357 | struct ide_atapi_pc pc; |
2378 | unsigned long flags; | ||
2379 | int retval, count = 0; | 2358 | int retval, count = 0; |
2380 | int sprev = !!(tape->caps[4] & 0x20); | 2359 | int sprev = !!(tape->caps[4] & 0x20); |
2381 | 2360 | ||
@@ -2388,41 +2367,9 @@ static int idetape_space_over_filemarks(ide_drive_t *drive, short mt_op, | |||
2388 | } | 2367 | } |
2389 | 2368 | ||
2390 | if (tape->chrdev_dir == IDETAPE_DIR_READ) { | 2369 | if (tape->chrdev_dir == IDETAPE_DIR_READ) { |
2391 | /* its a read-ahead buffer, scan it for crossed filemarks. */ | ||
2392 | tape->merge_stage_size = 0; | 2370 | tape->merge_stage_size = 0; |
2393 | if (test_and_clear_bit(IDETAPE_FLAG_FILEMARK, &tape->flags)) | 2371 | if (test_and_clear_bit(IDETAPE_FLAG_FILEMARK, &tape->flags)) |
2394 | ++count; | 2372 | ++count; |
2395 | while (tape->first_stage != NULL) { | ||
2396 | if (count == mt_count) { | ||
2397 | if (mt_op == MTFSFM) | ||
2398 | set_bit(IDETAPE_FLAG_FILEMARK, | ||
2399 | &tape->flags); | ||
2400 | return 0; | ||
2401 | } | ||
2402 | spin_lock_irqsave(&tape->lock, flags); | ||
2403 | if (tape->first_stage == tape->active_stage) { | ||
2404 | /* | ||
2405 | * We have reached the active stage in the read | ||
2406 | * pipeline. There is no point in allowing the | ||
2407 | * drive to continue reading any farther, so we | ||
2408 | * stop the pipeline. | ||
2409 | * | ||
2410 | * This section should be moved to a separate | ||
2411 | * subroutine because similar operations are | ||
2412 | * done in __idetape_discard_read_pipeline(), | ||
2413 | * for example. | ||
2414 | */ | ||
2415 | tape->next_stage = NULL; | ||
2416 | spin_unlock_irqrestore(&tape->lock, flags); | ||
2417 | idetape_wait_first_stage(drive); | ||
2418 | tape->next_stage = tape->first_stage->next; | ||
2419 | } else | ||
2420 | spin_unlock_irqrestore(&tape->lock, flags); | ||
2421 | if (tape->first_stage->rq.errors == | ||
2422 | IDETAPE_ERROR_FILEMARK) | ||
2423 | ++count; | ||
2424 | idetape_remove_stage_head(drive); | ||
2425 | } | ||
2426 | idetape_discard_read_pipeline(drive, 0); | 2373 | idetape_discard_read_pipeline(drive, 0); |
2427 | } | 2374 | } |
2428 | 2375 | ||